Skip to content

HDDS-16249. Fix no-op assertThat in TestOzoneClientRetriesOnExceptions - #11081

Merged
chungen0126 merged 1 commit into
apache:masterfrom
shuan1026:HDDS-16249
Aug 22, 2026
Merged

HDDS-16249. Fix no-op assertThat in TestOzoneClientRetriesOnExceptions#11081
chungen0126 merged 1 commit into
apache:masterfrom
shuan1026:HDDS-16249

Conversation

@shuan1026

Copy link
Copy Markdown
Contributor

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

@chungen0126
chungen0126 merged commit f61e35d into apache:master Aug 22, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants