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

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


The following commit(s) were added to refs/heads/master by this push:
     new ec96e716fba HDDS-15223. Stabilize 
TestReconAndAdminContainerCLI.testMissingContainer (#10258)
ec96e716fba is described below

commit ec96e716fbada274b8119de1b502cd2f0457cc70
Author: Arun Sarin <[email protected]>
AuthorDate: Thu Jun 4 12:56:27 2026 +0530

    HDDS-15223. Stabilize TestReconAndAdminContainerCLI.testMissingContainer 
(#10258)
---
 .../ozone/recon/TestReconAndAdminContainerCLI.java | 30 ++++++++++++++++------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java
 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java
index a41aeac735e..9514c05d6b2 100644
--- 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java
+++ 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java
@@ -43,6 +43,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.apache.hadoop.hdds.HddsConfigKeys;
@@ -104,6 +105,16 @@ class TestReconAndAdminContainerCLI {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(TestReconAndAdminContainerCLI.class);
 
+  /** Pause between SCM/Recon checks while waiting for matching reports. */
+  private static final int RM_RECON_COMPARE_POLL_INTERVAL_MS = 1000;
+  /** Max wait (Recon can trail SCM briefly). */
+  private static final int RM_RECON_COMPARE_WAIT_MS = 90_000;
+  /**
+   * Two matches in a row on purpose. A single agreeing poll can be luck while 
RM and Recon counts
+   * are still drifting past each other (HDDS-15223).
+   */
+  private static final int RM_RECON_COMPARE_STABLE_POLLS = 2;
+
   private static final OzoneConfiguration CONF = new OzoneConfiguration();
   private static ScmClient scmClient;
   private static MiniOzoneCluster cluster;
@@ -186,7 +197,6 @@ static void shutdown() {
    * but it's easier to test with Ratis ONE.
    */
   @Test
-  @Flaky("HDDS-15223")
   void testMissingContainer() throws Exception {
     String keyNameR1 = "key2";
     long containerID = setupRatisKey(recon, keyNameR1,
@@ -311,18 +321,22 @@ void testNodesInDecommissionOrMaintenance(
   }
 
   /**
-   * The purpose of this method, isn't to validate the numbers
-   * but to make sure that they are consistent between
-   * Recon and the ReplicationManager.
+   * Checks that SCM's replication manager and Recon show the same unhealthy 
stats
+   * (counts and RM sample IDs in Recon's list). Waits until that lines up for 
a short
+   * stretch of time so a one-off tick does not hide a real mismatch 
(HDDS-15223).
    */
   private static void compareRMReportToReconResponse(UnHealthyContainerStates 
containerState)
       throws Exception {
     assertNotNull(containerState);
 
-    // Both threads are running every 1 second.
-    // Wait until all values are equal.
-    GenericTestUtils.waitFor(() -> assertReportsMatch(containerState),
-        1000, 40000);
+    AtomicInteger stablePolls = new AtomicInteger(0);
+    GenericTestUtils.waitFor(() -> {
+      if (assertReportsMatch(containerState)) {
+        return stablePolls.incrementAndGet() >= RM_RECON_COMPARE_STABLE_POLLS;
+      }
+      stablePolls.set(0);
+      return false;
+    }, RM_RECON_COMPARE_POLL_INTERVAL_MS, RM_RECON_COMPARE_WAIT_MS);
   }
 
   private static boolean assertReportsMatch(UnHealthyContainerStates state) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to