adoroszlai commented on code in PR #8060:
URL: https://github.com/apache/ozone/pull/8060#discussion_r1992334858
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestContainerReportHandling.java:
##########
@@ -97,6 +95,19 @@ void
testDeletingOrDeletedContainerTransitionsToClosedWhenNonEmptyReplicaIsRepor
ContainerID containerID =
ContainerID.valueOf(keyLocation.getContainerID());
waitForContainerClose(cluster, containerID.getId());
+ // also wait till the container is closed in SCM
+ GenericTestUtils.waitFor(() -> {
+ ContainerManager containerManager =
cluster.getStorageContainerManager().getContainerManager();
+ try {
+ if (containerManager.getContainer(containerID).getState() !=
HddsProtos.LifeCycleState.CLOSED) {
+ return false;
+ }
+ } catch (ContainerNotFoundException e) {
+ return false;
+ }
+ return true;
+ }, 2000, 20000);
+
Review Comment:
I guess at this point SCM should already have the container,
`ContainerNotFoundException` can be considered a problem. If so, we could
reuse the check (extracted to a method in `TestHelper`) from the test's end:
https://github.com/apache/ozone/blob/6648965b5ce224cff535fd3bf633fcd251c54167/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestContainerReportHandling.java#L125-L132
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]