You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "desaikomal (via GitHub)" <gi...@apache.org> on 2023/06/01 19:38:04 UTC

[GitHub] [helix] desaikomal commented on a diff in pull request #2516: change undetermined check in unit test

desaikomal commented on code in PR #2516:
URL: https://github.com/apache/helix/pull/2516#discussion_r1213598636


##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/TestZooKeeperConnection.java:
##########
@@ -53,10 +53,11 @@ void testPersistWatcher() throws Exception {
       _zk.writeData(path, ("datat"+i).getBytes(), -1);
       _zk.create(path+"/c2_" +i, null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
     }
+    System.out.println("testPersistWatcher: rafter register one time listener, original listener received event count: " + get_count[0]);

Review Comment:
   nit: after 
   This is old test case, but we decided to use logger instead of system.  we can do it as part of other change.



##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/TestZooKeeperConnection.java:
##########
@@ -53,10 +53,11 @@ void testPersistWatcher() throws Exception {
       _zk.writeData(path, ("datat"+i).getBytes(), -1);
       _zk.create(path+"/c2_" +i, null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
     }
+    System.out.println("testPersistWatcher: rafter register one time listener, original listener received event count: " + get_count[0]);
+    // total number of event is 400. We will miss event now
     Assert.assertTrue(TestHelper.verify(() -> {
-          return (get_count[0].get() == 202);
-        }, TestHelper.WAIT_DURATION));
-    System.out.println("testPersistWatcher received event count: " + get_count[0]);
+      return (get_count[0].get() < 400);

Review Comment:
   is there any lower bound, ie get_count[0].get > X ?



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

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org