chihsuan commented on code in PR #11670:
URL: https://github.com/apache/ozone/pull/11670#discussion_r4347196977
##########
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:
Could we use `LambdaTestUtils.await` here? If this times out, the error no
longer says why the file read failed. The old code showed it, and `await` would
keep it.
--
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]