[
https://issues.apache.org/jira/browse/ZOOKEEPER-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16140320#comment-16140320
]
Michael Han commented on ZOOKEEPER-2877:
----------------------------------------
bq. I could not reproduce it.
This one is a flaky test for sure and we've seen it from time to time on our
nightly builds, albeit not very frequently.
It's not unusual that you can't reproduce a flaky test like this locally
because the failure scenarios are usually un-deterministic if's caused by
concurrency issues like race conditions or depend on other facts such as
interferences from other tests and the host load. My suggestions on reproducing
a test is to:
* Stress test it, in isolation or in batch with rest of unit tests. Easy to do
if you write a script or using Jenkins. When you run it enough number of times
you might get lucky to get a hit.
* Introduce faults in the test artificially which increase the probability of
hitting a failure. Examples including adding sleep calls here and there.
> Flaky Test: org.apache.zookeeper.server.quorum.Zab1_0Test.testNormalRun
> -----------------------------------------------------------------------
>
> Key: ZOOKEEPER-2877
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2877
> Project: ZooKeeper
> Issue Type: Bug
> Components: tests
> Reporter: Michael Han
>
> {noformat}
> Error Message
> expected:<1> but was:<0>
> Stacktrace
> junit.framework.AssertionFailedError: expected:<1> but was:<0>
> at
> org.apache.zookeeper.server.quorum.Zab1_0Test$6.converseWithLeader(Zab1_0Test.java:939)
> at
> org.apache.zookeeper.server.quorum.Zab1_0Test.testLeaderConversation(Zab1_0Test.java:398)
> at
> org.apache.zookeeper.server.quorum.Zab1_0Test.testNormalRun(Zab1_0Test.java:906)
> at
> org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)