Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-10173. findbugs: Random object used only once in TestBlockOutputStreamCorrectness #6131

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

adoroszlai
Copy link
Contributor

@adoroszlai adoroszlai commented Jan 31, 2024

What changes were proposed in this pull request?

Background: Spotbugs 4 finds more problems than Spotbugs 3, which we currently use. Upgrade to Spotbugs 4 is required for migration to Java 11+. This PR fixes a warning which is new to Spotbugs 4.

Refactor TestBlockOutputStreamCorrectness to avoid the need for new Random.

Also parameterize the test, to exercise both single-byte and array write path.

https://issues.apache.org/jira/browse/HDDS-10173

How was this patch tested?

Tested with Spotbugs 4:

$ ./hadoop-ozone/dev-support/checks/findbugs.sh -Dspotbugs.version=4.8.3.0 -am -pl :hdds-client
...
$ grep -c TestBlockOutputStreamCorrectness target/findbugs/summary.txt
0

CI:
https://github.com/adoroszlai/ozone/actions/runs/7716000984/job/21032183070#step:5:999

@adoroszlai adoroszlai self-assigned this Jan 31, 2024
@adoroszlai adoroszlai changed the title HDDS-10173. Random object created and used only once in TestBlockOutputStreamCorrectness HDDS-10173. findbugs: Random object used only once in TestBlockOutputStreamCorrectness Feb 1, 2024
Copy link
Contributor

@nandakumar131 nandakumar131 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@nandakumar131 nandakumar131 merged commit 49df646 into apache:master Feb 1, 2024
21 checks passed
@nandakumar131
Copy link
Contributor

Thanks @adoroszlai for the fix.

@adoroszlai adoroszlai deleted the HDDS-10173 branch February 1, 2024 15:30
@adoroszlai
Copy link
Contributor Author

Thanks @nandakumar131 for reviewing and merging this.

smengcl pushed a commit to smengcl/hadoop-ozone that referenced this pull request Feb 7, 2024
smengcl added a commit to smengcl/hadoop-ozone that referenced this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants