symat commented on a change in pull request #1256: ZOOKEEPER-2164: Quorum 
members can not rejoin after restart
URL: https://github.com/apache/zookeeper/pull/1256#discussion_r382449363
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/ZKTestCase.java
 ##########
 @@ -75,5 +77,30 @@ public void failed(Throwable e, Description method) {
         }
 
     };
+    public interface WaitForCondition {
+        /**
+         * @return true when success
+         */
+        boolean evaluate();
+    }
+
+    /**
+     * Wait for condition to be true; otherwise fail the test if it exceed
+     * timeout
+     * @param msg       error message to print when fail
+     * @param condition condition to evaluate
+     * @param timeout   timeout in seconds
+     * @throws InterruptedException
+     */
+    public void waitFor(String msg, WaitForCondition condition, int timeout) 
throws InterruptedException {
 
 Review comment:
   this is a very useful helper function, great that we will have it also for 
the 3.5 branch!

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


With regards,
Apache Git Services

Reply via email to