GitHub user afine opened a pull request:

    https://github.com/apache/zookeeper/pull/270

    ZOOKEEPER-2798 Fix flaky test: 
org.apache.zookeeper.test.ReadOnlyModeTest.testConnectionEvents

    When a client connection occurs, the `ClientCnxn`'s `state` is changed and 
then a watcher event is queued. This test is unreliable because it expects the 
watcher to fire immediately after the state changes. This test adds a 
`CountDownLatch` to the watcher, to  better track when it has been fired. 
    
    This flaky test can be reliably reproduced by adding a `Thread.sleep` right 
before `states.add(event.getState());`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/afine/zookeeper ZOOKEEPER-2798

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zookeeper/pull/270.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #270
    
----
commit 2a4dcd2e7726a041d54f5c114eec0b035bf74989
Author: Abraham Fine <[email protected]>
Date:   2017-06-01T20:52:07Z

    ZOOKEEPER-2798: Fix flaky test: 
org.apache.zookeeper.test.ReadOnlyModeTest.testConnectionEvents

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to