elek opened a new pull request #2188: URL: https://github.com/apache/ozone/pull/2188
## What changes were proposed in this pull request? The `TestContainerDeletionChoosingPolicy#testRandomChoosingPolicy` is reported to be intermittent. > Observed in this CI run: https://github.com/apache/ozone/pull/2179/checks?check_run_id=2423463857 > Bundle is attached to issue. It seems that #1885 introduced a few problems. (It was new to me, so I try to explain here the changes) ``` -data.incrPendingDeletionBlocks(random.nextInt(numContainers) + 1); +data.incrPendingDeletionBlocks(20); ``` It's better to use fixed size of containers as it's very hard to predict the test behaviors without that. ``` for (int i = 0; i < result1.size(); i++) { ``` That's the root cause of the problem. As we have block size based selection, the container size may be less than the requested block size. ``` List<ContainerBlockInfo> result1 = blockDeletingService .chooseContainerForBlockDeletion(50, deletionPolicy); ``` Here we should use block number s(50) instead of the container numbers (was 10 earlier) ``` for (int j = 0; j < 100; j++) { ``` As result1 and result2 returns with 3 containers it's better to check multiple times the randomness. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-5147 ## How was this patch tested? Unit test is passed 7000 times locally. Without the patch it fails during the first 50-100 executions. -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
