This is an automated email from the ASF dual-hosted git repository.

jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new afc62ab  Fix the flaky test (#749)
afc62ab is described below

commit afc62ab7efe74342702451f074740674cf25eda0
Author: Yi Wang <[email protected]>
AuthorDate: Wed Feb 12 10:53:01 2020 -0800

    Fix the flaky test (#749)
    
    Fix the unstable TestZkWatch
    
    The root cause of the instability is due to the incorrect condition notify 
time: it should notify other threads after zkClient finishes the unsubscribing 
the listener
---
 helix-core/src/test/java/org/apache/helix/manager/zk/TestZKWatch.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKWatch.java 
b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKWatch.java
index 53017cb..1b6d543 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKWatch.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKWatch.java
@@ -59,8 +59,8 @@ public class TestZKWatch extends ZkUnitTestBase {
 
       @Override
       public void handleDataDeleted(String path) throws Exception {
-        deleteCondition.countDown();
         _zkClient.unsubscribeDataChanges(path, this);
+        deleteCondition.countDown();
       }
     };
     _zkClient.subscribeDataChanges(existPath, dataListener);
@@ -91,8 +91,8 @@ public class TestZKWatch extends ZkUnitTestBase {
     IZkChildListener childListener = new IZkChildListener() {
       @Override
       public void handleChildChange(String parentPath, List<String> 
childrenPaths) throws Exception {
-        deleteCondition.countDown();
         _zkClient.unsubscribeChildChanges(parentPath, this);
+        deleteCondition.countDown();
       }
     };
     _zkClient.subscribeChildChanges(parentPath, childListener);

Reply via email to