Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper, mail # dev - QuorumTest.testFollowersStartAfterLeader


Copy link to this message
-
Re: QuorumTest.testFollowersStartAfterLeader
Eugene Koontz 2011-06-21, 21:33
On 6/21/11 2:12 PM, Patrick Hunt wrote:
> Hi Eugene, that looks right to me. (did that fix it for you?)
>
> In addition to the anti-pattern I mentioned earlier, another one to
> look for is slow running tests -- often times a test will run slowly
> that could be coded in a different way to run much more quickly.
> Notice here that we don't even wait the second if the test is already
> passing. Although we might run for a much longer time if needed. (this
> all adds up when you have hundreds/thousands of tests).
>
> btw, you might put that comment directly into your assert. Also take a
> look at Assert.fail("foo") instead of assertTrue(false). (it's a nit
> though).
>
> Patrick
>
Hi Patrick,

I created https://issues.apache.org/jira/browse/ZOOKEEPER-1103 and added
a patch. I used Assert.fail() as you recommended. Your comments
regarding avoiding unnecessary sleep()s are well said - I hate waiting
for long tests! :)

-Eugene