File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
test/distributed/org/apache/cassandra/distributed/test/tracking Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -149,12 +149,16 @@ public void testBroadcastOffsetsDiscoveredMetric() throws Throwable
149149 cluster .get (1 ).runOnInstance (() -> MutationTrackingService .instance .broadcastOffsetsForTesting ());
150150
151151 // Wait for broadcasts to propagate to node 3
152+ long [] previousCount = {0 };
152153 Awaitility .await ()
153154 .atMost (Duration .ofSeconds (5 ))
154155 .pollInterval (Duration .ofMillis (100 ))
155156 .until (() -> {
156- long node3Delta = cluster .get (3 ).callOnInstance (() -> MutationTrackingMetrics .instance .broadcastOffsetsDiscovered .getCount ()) - initialNode3Count ;
157- return node3Delta > 0 ;
157+ long currentCount = cluster .get (3 ).callOnInstance (() -> MutationTrackingMetrics .instance .broadcastOffsetsDiscovered .getCount ());
158+ boolean hasDiscoveredOffsets = currentCount > initialNode3Count ;
159+ boolean isStable = hasDiscoveredOffsets && currentCount == previousCount [0 ];
160+ previousCount [0 ] = currentCount ;
161+ return isStable ;
158162 });
159163
160164 // Get the count after first broadcast
You can’t perform that action at this time.
0 commit comments