rich7420 opened a new pull request, #11670:
URL: https://github.com/apache/ozone/pull/11670

   ## What changes were proposed in this pull request?
   
   `TestBlockDeletingService#testBlockDeletion` reads the container checksum 
file right after `deleteAndWait`. `deleteAndWait` only waits until 
`PeriodicalTask#run()` returns, and `run()` submits each `BlockDeletingTask` 
with `CompletableFuture.runAsync` without waiting for it. If the task has not 
written the checksum file yet, the test fails with `Failed to read container 
checksum tree file`. `testChecksumFileUpdatedWhenDeleteRetried` uses the same 
assertion.
   
   Make `assertDeletionsInChecksumFile` wait until the checksum file records 
the expected number of deleted blocks, then assert the exact count. The other 
checks in `testBlockDeletion` already wait for the state they read.
   
   `deleteAndWait` is not changed. Making it wait for the submitted tasks would 
change the timing of every caller, so it is left for a follow-up if needed.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17257
   
   ## How was this patch tested?
   
   - With a 500 ms sleep added at the start of 
`ContainerChecksumTreeManager#addDeletedBlocks`, `testBlockDeletion` and 
`testChecksumFileUpdatedWhenDeleteRetried` failed in all 8 parameterizations 
without the fix, with the same error as CI, and passed with the fix.
   - `TestBlockDeletingService` passed locally on JDK 21: 73 tests, 4 skipped.
   - `checkstyle.sh` and `pmd:check` passed.
   - [Fork CI](https://github.com/rich7420/ozone/actions/runs/39645172979) 
passed.
   - `TestBlockDeletingService` passed 100/100 in the [10×10 
flaky-test-check](https://github.com/rich7420/ozone/actions/runs/39645171841).
   


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