[
https://issues.apache.org/jira/browse/ZOOKEEPER-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15413807#comment-15413807
]
Michael Han commented on ZOOKEEPER-2508:
----------------------------------------
Great to see improvements on the tests! I have two quick comments:
* Would it better if we refactor this code into a utility class / method which
takes a set of parameters such as host port and return a connected zk handle?
{code}
CountdownWatcher watcher = new CountdownWatcher();
final ZooKeeper zk = new ZooKeeper(HOSTPORT, CONNECTION_TIMEOUT, watcher);
watcher.waitForConnected(CONNECTION_TIMEOUT);
{code}
* The pre-commit build has two tests (ACLTest.testAcls and
ObserverTest.testObserver) that this patch touches failed. Might relate to the
change in this patch.
> Many ZooKeeper tests are flaky because they proceed with zk operation without
> connecting to ZooKeeper server.
> -------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-2508
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2508
> Project: ZooKeeper
> Issue Type: Bug
> Components: tests
> Reporter: Arshad Mohammad
> Assignee: Arshad Mohammad
> Fix For: 3.5.3
>
> Attachments: ZOOKEEPER-2508-01.patch
>
>
> Many ZooKeeper tests are flaky because they proceed with zk operation without
> connecting to ZooKeeper server.
> Recently in our build
> {{org.apache.zookeeper.server.ZooKeeperServerMainTest.testStandalone()}}
> failed.
> After analyzing we found that it is failed because it is not waiting for
> ZooKeeper client get connected to server. In this case normally zookeeper
> client gets connected immediately but if not connected immediately the test
> case is bound to fail.
> Not only ZooKeeperServerMainTest but there are many other classes which have
> such test cases. This jira is to address all those test cases.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)