PapaCharlie commented on code in PR #1989:
URL: https://github.com/apache/zookeeper/pull/1989#discussion_r1131481216


##########
zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/WatcherCleanerTest.java:
##########
@@ -171,4 +177,15 @@ public void testDeadWatcherMetrics() {
         assertEquals(20D, ((Long) 
values.get("p99_dead_watchers_cleaner_latency")).doubleValue(), 20);
     }
 
+    /**
+     * Waits in a loop for the given metric to have the required value. If the 
given timeout is reached, the test fails.
+     */
+    private static void waitForMetricValue(String metricName, Object expected, 
long timeoutMs) throws InterruptedException {

Review Comment:
   Nice! I refactored it



-- 
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: [email protected]

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

Reply via email to