adoroszlai opened a new pull request, #5993:
URL: https://github.com/apache/ozone/pull/5993

   ## What changes were proposed in this pull request?
   
   Several tests fail when run with Java 17 due to:
   
   ```
   java.lang.ExceptionInInitializerError
        at 
org.apache.hadoop.ozone.common.TestChecksumImplsComputeSameValues.testCRC32CImplsMatch(TestChecksumImplsComputeSameValues.java:66)
        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)
   Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make 
field boolean java.nio.ByteBuffer.isReadOnly accessible: module java.base does 
not "opens java.nio" to unnamed module @75eeccf5
        at 
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
        at 
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at 
java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
        at 
org.apache.hadoop.ozone.common.ChecksumByteBufferImpl.<clinit>(ChecksumByteBufferImpl.java:44)
        ... 4 more
   ```
   
   `ozone` command does open some packages for `ChecksumByteBufferImpl` to work 
(see #3759).  This change applies the same logic (extracted to 
`ozone-functions.sh`) in `junit.sh` to Surefire `argLine`.
   
   https://issues.apache.org/jira/browse/HDDS-10123
   
   ## How was this patch tested?
   
   Ran tests that failed previously with Java 17.
   
   Example:
   
   ```
   $ JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 
./hadoop-ozone/dev-support/checks/junit.sh -am -pl :hdds-common 
-Dtest='TestChecksumImplsComputeSameValues'
   ...
   Java version: 17.0.9
   ...
   Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.206 s -- 
in org.apache.hadoop.ozone.common.TestChecksumImplsComputeSameValues
   ```
   
   CI (also verifies that refactoring `bin/ozone` did not cause regression):
   https://github.com/adoroszlai/ozone/actions/runs/7505840912


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to