Skip to content

Commit

Permalink
ZOOKEEPER-4200: Widen latency window in WatcherCleanerTest
Browse files Browse the repository at this point in the history
`WatcherCleanerTest` performs latency checks which fail when outside of a 20+Xms window.  Before this patch, X was 5ms—whereas 30+ms is frequently seen on an i5 Mac Mini running macOS Catalina.

This "dumb" patch just widens the window to 20ms, which makes it "work on my machine," but could obviously still fail in a loaded environment or VM.

Author: Damien Diederen <[email protected]>

Reviewers: Enrico Olivelli <[email protected]>, Mate Szalay-Beko <[email protected]>

Closes #1592 from ztzg/ZOOKEEPER-4200-widen-latency-window
  • Loading branch information
ztzg committed Mar 6, 2021
1 parent 679cc2b commit 5d47a4e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ public void testDeadWatcherMetrics() {

assertEquals(3L, values.get("cnt_dead_watchers_cleaner_latency"));

//Each latency should be a little over 20 ms, allow 5 ms deviation
assertEquals(20D, (Double) values.get("avg_dead_watchers_cleaner_latency"), 5);
assertEquals(20D, ((Long) values.get("min_dead_watchers_cleaner_latency")).doubleValue(), 5);
assertEquals(20D, ((Long) values.get("max_dead_watchers_cleaner_latency")).doubleValue(), 5);
assertEquals(20D, ((Long) values.get("p50_dead_watchers_cleaner_latency")).doubleValue(), 5);
assertEquals(20D, ((Long) values.get("p95_dead_watchers_cleaner_latency")).doubleValue(), 5);
assertEquals(20D, ((Long) values.get("p99_dead_watchers_cleaner_latency")).doubleValue(), 5);
//Each latency should be a little over 20 ms, allow 20 ms deviation
assertEquals(20D, (Double) values.get("avg_dead_watchers_cleaner_latency"), 20);
assertEquals(20D, ((Long) values.get("min_dead_watchers_cleaner_latency")).doubleValue(), 20);
assertEquals(20D, ((Long) values.get("max_dead_watchers_cleaner_latency")).doubleValue(), 20);
assertEquals(20D, ((Long) values.get("p50_dead_watchers_cleaner_latency")).doubleValue(), 20);
assertEquals(20D, ((Long) values.get("p95_dead_watchers_cleaner_latency")).doubleValue(), 20);
assertEquals(20D, ((Long) values.get("p99_dead_watchers_cleaner_latency")).doubleValue(), 20);
}

}

0 comments on commit 5d47a4e

Please sign in to comment.