rich7420 commented on code in PR #11670:
URL: https://github.com/apache/ozone/pull/11670#discussion_r4349771695


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java:
##########
@@ -1304,17 +1305,19 @@ private void 
setLayoutAndSchemaForTest(ContainerTestVersionInfo versionInfo) {
   }
 
   private void assertDeletionsInChecksumFile(ContainerData data, int 
expectedNumBlocks) {
-    ContainerProtos.ContainerChecksumInfo checksumInfo = null;
+    // deleteAndWait only waits for the deleting tasks to be submitted, so the 
checksum file may not be written yet.
     try {
-      checksumInfo = readChecksumFile(data);
-    } catch (IOException ex) {
-      fail("Failed to read container checksum tree file: " + ex.getMessage());
+      GenericTestUtils.waitFor((CheckedSupplier<Boolean, IOException>) () ->
+          getNumDeletedBlocksInChecksumFile(data) >= expectedNumBlocks, 100, 
3000);

Review Comment:
   Thanks @chihsuan, switched to `LambdaTestUtils.await` in 367a76640c. On 
timeout the last read failure is now kept in the `TimeoutException` message and 
cause.
   



-- 
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]

Reply via email to