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-10725. TestContentGenerator#writeWithHsync fails with Java 17 #6570

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Fix test failure with Java 17:

[ERROR] Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.323 s <<< FAILURE! - in org.apache.hadoop.ozone.freon.TestContentGenerator
[ERROR] org.apache.hadoop.ozone.freon.TestContentGenerator.writeWithHsync  Time elapsed: 0.294 s  <<< ERROR!
java.lang.NullPointerException: Cannot read the array length because "this.buf" is null
	at java.base/java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:97)
	at java.base/java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:130)
	at org.apache.hadoop.ozone.freon.ContentGenerator.write(ContentGenerator.java:98)
	at org.apache.hadoop.ozone.freon.TestContentGenerator.writeWithHsync(TestContentGenerator.java:113)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

Switching to mockito-inline fixes the problem (related issue 1, 2).

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

How was this patch tested?

Tested with Java 17:

JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 \
  ./hadoop-ozone/dev-support/checks/junit.sh \
  -am -pl :ozone-tools -Dtest='TestContentGenerator'
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.614 s - in org.apache.hadoop.ozone.freon.TestContentGenerator

Regular CI:
https://github.com/adoroszlai/ozone/actions/runs/8764901899

@adoroszlai adoroszlai self-assigned this Apr 20, 2024
Copy link
Contributor

@smengcl smengcl left a comment

Choose a reason for hiding this comment

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

Thanks @adoroszlai !

@adoroszlai adoroszlai merged commit d99529c into apache:master Apr 21, 2024
38 checks passed
@adoroszlai adoroszlai deleted the HDDS-10725 branch April 21, 2024 19:15
@adoroszlai
Copy link
Contributor Author

Thanks @smengcl for the review.

jojochuang pushed a commit to jojochuang/ozone that referenced this pull request May 29, 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