[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13714823#comment-13714823
 ] 

Jeffrey Zhong commented on ZOOKEEPER-1733:
------------------------------------------

The test case failed in trunk as well on windows. Sometimes failed with a 
different error(shown below) than the "Leader hasn't joined" error. How do you 
think to remove the lead thread alive check from the 3.4 test case as it should 
be covered in the majority verification? Thanks.

{code}
    [junit] java.lang.AssertionError: Fewer than a a majority has joined
    [junit]     at org.junit.Assert.fail(Assert.java:93)
    [junit]     at 
org.apache.zookeeper.test.FLETest.runElection(FLETest.java:348)
    [junit]     at 
org.apache.zookeeper.test.FLETest.testTripleElection(FLETest.java:277)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:597)
    ...
{code}


                
> FLETest#testLE is flaky on windows boxes
> ----------------------------------------
>
>                 Key: ZOOKEEPER-1733
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1733
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.5
>            Reporter: Jeffrey Zhong
>            Priority: Minor
>
> FLETest#testLE fail intermittently on windows boxes. The reason is that in 
> LEThread#run() we have:
> {code}
>                                 if(leader == i){
>                                     synchronized(finalObj){
>                                         successCount++;
>                                         if(successCount > (count/2)) 
> finalObj.notify();
>                                     }
>                                     break;
>                                 }
> {code}
> Basically once we have a confirmed leader, the leader thread dies due to the 
> "break" of while loop. 
> While in the verification step, we check if the leader thread alive or not as 
> following:
> {code}
>        if(threads.get((int) leader).isAlive()){
>            Assert.fail("Leader hasn't joined: " + leader);
>        }
> {code}
> On windows boxes, the above verification step fails frequently because leader 
> thread most likely already exits.
> Do we know why we have the leader alive verification step only lead thread 
> can bump up successCount >= count/2?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to