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

adoroszlai 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 8bc575ca156 HDDS-16514. Fix intermittent 
TestReconContainerManager.testUpdateAndRemoveContainerReplica (#11274)
8bc575ca156 is described below

commit 8bc575ca1566125475d12cdfb0a3a2b238e0fb61
Author: rjgoyln <[email protected]>
AuthorDate: Sun Sep 20 14:27:34 2026 +0800

    HDDS-16514. Fix intermittent 
TestReconContainerManager.testUpdateAndRemoveContainerReplica (#11274)
---
 .../org/apache/hadoop/ozone/recon/scm/TestReconContainerManager.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconContainerManager.java
 
b/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconContainerManager.java
index a7faa2d64b2..bd59c52a003 100644
--- 
a/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconContainerManager.java
+++ 
b/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconContainerManager.java
@@ -51,6 +51,7 @@
 import 
org.apache.hadoop.hdds.scm.container.common.helpers.ContainerWithPipeline;
 import org.apache.hadoop.hdds.scm.ha.SCMHAManager;
 import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
+import org.apache.ozone.test.GenericTestUtils;
 import org.junit.jupiter.api.Test;
 
 /**
@@ -292,7 +293,7 @@ ContainerInfo newContainerInfo(long containerId, Pipeline 
pipeline) {
 
   @Test
   public void testUpdateAndRemoveContainerReplica()
-      throws IOException, TimeoutException {
+      throws IOException, InterruptedException, TimeoutException {
     // Sanity checking updateContainerReplica and ContainerReplicaHistory
 
     // Init Container 1
@@ -340,6 +341,8 @@ public void testUpdateAndRemoveContainerReplica()
     containerReplica1 = ContainerReplica.newBuilder()
         .setContainerID(containerID1).setContainerState(State.OPEN)
         .setDatanodeDetails(datanodeDetails1).setSequenceId(1051L).build();
+    // firstSeen and lastSeen are stamped from a single clock read, so wait 
for the millisecond to tick.
+    GenericTestUtils.waitFor(() -> System.currentTimeMillis() > 
repHist1.getFirstSeenTime(), 1, 1000);
     containerManager.updateContainerReplica(containerID1, containerReplica1);
     // Should still have 1 entry in the replica history map
     assertEquals(1, repHistMap.size());


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

Reply via email to