[
https://issues.apache.org/jira/browse/HDDS-16249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Meng-Shuan Tsai updated HDDS-16249:
-----------------------------------
Status: Patch Available (was: Open)
> TestOzoneClientRetriesOnExceptions#testMaxRetriesByOzoneClient has a no-op
> assertThat
> -------------------------------------------------------------------------------------
>
> Key: HDDS-16249
> URL: https://issues.apache.org/jira/browse/HDDS-16249
> Project: Apache Ozone
> Issue Type: Bug
> Reporter: Meng-Shuan Tsai
> Assignee: Meng-Shuan Tsai
> Priority: Major
> Labels: pull-request-available
>
> TestOzoneClientRetriesOnExceptions.java:204 (testMaxRetriesByOzoneClient) has
> a no-op assertion, no test run needed to see it - it's a static code issue,
> not a runtime failure:
> {code:java}
> assertThat(containerList.contains(containerID));
> {code}
> assertThat(boolean) returns an AbstractBooleanAssert; without a trailing
> isTrue()/isFalse() the object is discarded and nothing is ever checked, so
> this line passes unconditionally regardless of the boolean's value.
> See AssertJ source (this project pins assertj-core 3.27.7, per pom.xml):
> [https://github.com/assertj/assertj/blob/assertj-build-3.27.7/assertj-core/src/main/java/org/assertj/core/api/Assertions.java#L361]
> and
> [https://github.com/assertj/assertj/blob/assertj-build-3.27.7/assertj-core/src/main/java/org/assertj/core/api/AbstractBooleanAssert.java#L62-L84]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]