narendly commented on a change in pull request #1149:
URL: https://github.com/apache/helix/pull/1149#discussion_r454141012



##########
File path: 
helix-core/src/test/java/org/apache/helix/integration/TestZkConnectionLost.java
##########
@@ -103,6 +104,28 @@ public void afterClass() throws Exception {
     TestHelper.stopZkServer(_zkServerRef.get());
   }
 
+  @Test
+  public void testDisconnectWhenConnectionBreak() throws Exception {
+    _zkServerRef.get().shutdown();
+    AtomicBoolean disconnected = new AtomicBoolean(false);
+    Thread testThread = new Thread("Testing HelixManager disconnect") {
+      @Override
+      public void run() {
+        _controller.disconnect();
+        disconnected.set(true);
+      }
+    };
+    try {
+      testThread.start();
+      testThread.join(5000);

Review comment:
       Instead of giving a hard-coded timeout value, do you think we could use 
a CountDownLatch for this so the test doesn't depend on timing?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to