This is an automated email from the ASF dual-hosted git repository.

polyzos pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss.git


The following commit(s) were added to refs/heads/main by this push:
     new d07493c08 fluss-3188: Fixing flaky test 
CoordinatorEventManagerTest.testMetricsUpdatedImmediatelyOnStartup (#3210)
d07493c08 is described below

commit d07493c08cecea68e83cc09c8ea06a20efaa4cc8
Author: vamossagar12 <[email protected]>
AuthorDate: Mon May 4 12:32:15 2026 +0530

    fluss-3188: Fixing flaky test 
CoordinatorEventManagerTest.testMetricsUpdatedImmediatelyOnStartup (#3210)
---
 .../server/coordinator/event/CoordinatorEventManagerTest.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/fluss-server/src/test/java/org/apache/fluss/server/coordinator/event/CoordinatorEventManagerTest.java
 
b/fluss-server/src/test/java/org/apache/fluss/server/coordinator/event/CoordinatorEventManagerTest.java
index b3d542e0e..48bfd51bc 100644
--- 
a/fluss-server/src/test/java/org/apache/fluss/server/coordinator/event/CoordinatorEventManagerTest.java
+++ 
b/fluss-server/src/test/java/org/apache/fluss/server/coordinator/event/CoordinatorEventManagerTest.java
@@ -92,7 +92,14 @@ class CoordinatorEventManagerTest {
                             TestingMetricGroups.COORDINATOR_METRICS
                                     .getMetrics()
                                     
.get(MetricNames.ACTIVE_TABLET_SERVER_COUNT);
-            assertThat(activeTabletServerCount.getValue()).isEqualTo(2);
+            // The gauge reads the volatile tabletServerCount field which is 
updated
+            // after the AccessContextEvent future completes. Use retry to 
handle
+            // the brief window between metricsUpdateCount increment (inside 
the
+            // event processor) and the volatile field assignment (after
+            // getResultFuture().get() in updateMetricsViaAccessContext).
+            retry(
+                    Duration.ofMinutes(1),
+                    () -> 
assertThat(activeTabletServerCount.getValue()).isEqualTo(2));
         } finally {
             manager.close();
             TestingMetricGroups.COORDINATOR_METRICS.close();

Reply via email to