siddhantsangwan commented on code in PR #8060:
URL: https://github.com/apache/ozone/pull/8060#discussion_r1993374518


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestContainerReportHandlingWithHA.java:
##########
@@ -113,23 +110,7 @@ void 
testDeletingOrDeletedContainerTransitionsToClosedWhenNonEmptyReplicaIsRepor
         // restart a DN and wait for the container to get CLOSED in all SCMs
         HddsDatanodeService dn = 
cluster.getHddsDatanode(keyLocation.getPipeline().getFirstNode());
         cluster.restartHddsDatanode(dn.getDatanodeDetails(), false);
-        ContainerManager[] array = new ContainerManager[numSCM];
-        for (int i = 0; i < numSCM; i++) {
-          array[i] = 
cluster.getStorageContainerManager(i).getContainerManager();
-        }
-        GenericTestUtils.waitFor(() -> {
-          try {
-            for (ContainerManager manager : array) {
-              if (manager.getContainer(containerID).getState() != 
HddsProtos.LifeCycleState.CLOSED) {
-                return false;
-              }
-            }
-            return true;
-          } catch (ContainerNotFoundException e) {
-            fail(e);
-          }
-          return false;
-        }, 2000, 20000);
+        waitForContainerStateInSCM(cluster.getScmLeader(), containerID, 
HddsProtos.LifeCycleState.CLOSED);

Review Comment:
   The point of this test is that the container should eventually move to 
`CLOSED` in all three SCMs, so we should check the other SCMs as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to