kezhuw commented on code in PR #1989:
URL: https://github.com/apache/zookeeper/pull/1989#discussion_r1130317025
##########
zookeeper-server/src/test/java/org/apache/zookeeper/server/watch/WatcherCleanerTest.java:
##########
@@ -158,7 +162,9 @@ public void testDeadWatcherMetrics() {
Map<String, Object> values = MetricsUtils.currentServerMetrics();
assertThat("Adding dead watcher should be stalled twice", (Long)
values.get("add_dead_watcher_stall_time"), greaterThan(0L));
assertEquals(3L, values.get("dead_watchers_queued"), "Total dead
watchers added to the queue should be 3");
- assertEquals(3L, values.get("dead_watchers_cleared"), "Total dead
watchers cleared should be 3");
+ // This metric is updated _after_ the dead watcher listener is
invoked, so it is not always immediately visible,
+ // hence the wait.
+ waitForMetricValue("dead_watchers_cleared", 3L, 5_000);
Review Comment:
Seems that both `dead_watchers_cleared` and
`cnt_dead_watchers_cleaner_latency` are suffer from same issues. I think we
should treat them same.
--
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]