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



##########
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:
       I don't think so. Maybe I can make it a longer timeout. But if the logic 
is not working as expected, then the thread will never finish. So I'm not sure 
how the CountDownLatch can help here. Maybe you can elaborate on your idea?




----------------------------------------------------------------
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