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

xyuanlu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c93dec1b Fix the CI failure caused by metrics not being updated 
immediately. (#2547)
5c93dec1b is described below

commit 5c93dec1be9f7109f62ead202057095d10ee38e1
Author: Komal Desai <[email protected]>
AuthorDate: Tue Jul 11 11:10:16 2023 -0700

    Fix the CI failure caused by metrics not being updated immediately. (#2547)
    
    Failure is related to missing-top-state metrics being not reported 
immediately
    after external state has been updated.
    As we know that pipeline runs multiple times and it is possible that 
pipeline
    with missing-top-state is not yet completed.
    
    Instead of immediately checking, do it using Verify() helper method.
---
 .../apache/helix/monitoring/mbeans/TestClusterAggregateMetrics.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAggregateMetrics.java
 
b/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAggregateMetrics.java
index 1229f4784..f42b6f263 100644
--- 
a/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAggregateMetrics.java
+++ 
b/helix-core/src/test/java/org/apache/helix/monitoring/mbeans/TestClusterAggregateMetrics.java
@@ -206,7 +206,11 @@ public class TestClusterAggregateMetrics extends 
ZkTestBase {
     Assert.assertTrue(verifier.verifyByPolling());
 
     expectedMetricValues.put(WITHOUT_TOPSTATE_COUNT, 0L);
-    Assert.assertTrue(verifyMetrics(expectedMetricValues));
+
+    result = TestHelper.verify(() -> {
+      return verifyMetrics(expectedMetricValues);
+    }, TestHelper.WAIT_DURATION);
+    Assert.assertTrue(result);
 
     // Drop the resource and check that all metrics are zero.
     _setupTool.dropResourceFromCluster(CLUSTER_NAME, TEST_DB);

Reply via email to