adoroszlai opened a new pull request, #5493: URL: https://github.com/apache/ozone/pull/5493
## What changes were proposed in this pull request? Fix intermittent failure in `TestOpenKeyCleanupService`. There were several small items that contributed to the failures: 1. The test waited until `runCount` was incremented, then made some assertions. However, `runCount` is incremented at the start of the cleanup task, so the other changes may have not been done when the test checked. It needs to wait for `submittedKeyCount` to reach the expected value, since this counter is increased as the last step of the task. 2. `OpenKeyCleanupService` performs two tasks per run (processes different bucket layouts separately). Tests use a combination of keys in the two layouts, hence it needs to wait until `runCount` is increased by both tasks. 3. OM is stopped after each test case. We need to wait (`join()`) for it to finish stopping. 4. Instead of fixed amount of `sleep`, use `waitFor` in more places. Use longer max. wait time to avoid intermittent timeouts. Additional changes: * replace repeated `(int) SERVICE_INTERVAL.toMillis()` with constant value * remove unrelated class comment (leftover from `TestKeyDeletingService`) * add assertion message for `assertTrue(... >= ...)` to get actual values in case of failure * replace `STAND_ALONE` replication with `RATIS`, to avoid warnings from `QuotaUtil` in the log https://issues.apache.org/jira/browse/HDDS-8871 ## How was this patch tested? Executed the test 500 times twice: https://github.com/adoroszlai/hadoop-ozone/actions/runs/6638564445 https://github.com/adoroszlai/hadoop-ozone/actions/runs/6640547634 Regular CI: https://github.com/adoroszlai/hadoop-ozone/actions/runs/6641074083 -- 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]
