HDDS-16249. Fix no-op assertThat in TestOzoneClientRetriesOnExceptions - #11081
Merged
Conversation
…lient has a no-op assertThat
chungen0126
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
TestOzoneClientRetriesOnExceptions#testMaxRetriesByOzoneClient had a no-op assertion:
assertThat(containerList.contains(containerID));assertThat(boolean) returns an AbstractBooleanAssert that is discarded without a trailing isTrue()/isFalse() call, so this line never actually checked anything.
This PR adds .isFalse():
assertThat(containerList.contains(containerID)).isFalse();matching the loop's evident intent: each newly-allocated entry should get a containerID not already seen in this loop, before it is added to containerList, per the comment a few lines below about blocks being allocated to "N+1 different containers".
Note: with the assertion active, local runs occasionally hit a failure here (~1 in 5 runs), this may be a flaky test and looks related to the pipeline/container allocation behavior discussed under HDDS-16235. Filing that as a follow-up rather than fixing it in this PR, to keep this change scoped to the assertion bug.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16249
How was this patch tested?
mvn -pl :ozone-integration-test test -Dtest=TestOzoneClientRetriesOnExceptions -DskipShade -DskipRecon