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

jnr-posix-3.1.16: Test failures seen on x86_64 #183

Open
pooja0805 opened this issue May 19, 2023 · 7 comments
Open

jnr-posix-3.1.16: Test failures seen on x86_64 #183

pooja0805 opened this issue May 19, 2023 · 7 comments

Comments

@pooja0805
Copy link

Hello,

I've encountered 4 test failures while executing the test suite for jnr-posix v3.1.16 using the command mvn test. The specific errors can be found in the log provided below:

[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.github.jnr:jnr-posix >----------------------
[INFO] Building jnr-posix 3.1.16
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ jnr-posix ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jnr-posix ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/test/jnr-posix/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jnr-posix ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (java9-compile) @ jnr-posix ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (bundle-manifest) @ jnr-posix ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jnr-posix ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/test/jnr-posix/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ jnr-posix ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ jnr-posix ---
[INFO] Surefire report directory: /home/test/jnr-posix/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running jnr.posix.CryptTesRtu
nning jnr.posix.ConfstrTest
Successfully loaded native POSIX impl.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.278 sec - iTne sjtnsr .rpuons:i x1.,C rFyapitlTuersets
: 0, Errors: 0, Skipped: 0, Time elapsed: 0.272 sec - in jnr.posix.ConfstrTest
Running jnr.posix.POSIXFactoryTest
Running jnr.posix.PasswdTest
Successfully loaded native POSIX impl.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.279 sec - in jnr.posix.PasswdTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.28 sec - in jnr.posix.POSIXFactoryTest
Running jnr.posix.HANDLETest
Running jnr.posix.JavaPOSIXTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.066 sec - in jnr.posix.HANDLETest
Running jnr.posix.FileTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.319 sec - in jnr.posix.JavaPOSIXTest
Running jnr.posix.IOTest
Successfully loaded native POSIX impl.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by jnr.posix.JavaLibCHelper$ReflectiveAccess (file:/home/test/jnr-posix/target/classes/) to method sun.nio.ch.SelChImpl.getFD()
WARNING: Please consider reporting this to the maintainers of jnr.posix.JavaLibCHelper$ReflectiveAccess
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Successfully loaded native POSIX impl.
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.312 sec - in jnr.posix.IOTest
Running jnr.posix.EnvTest
Successfully loaded native POSIX impl.
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.275 sec - in jnr.posix.EnvTest
Running jnr.posix.HostnameTest
Successfully loaded native POSIX impl.
Tests run: 3, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.268 sec - in jnr.posix.HostnameTest
Running jnr.posix.util.PlatformTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec - in jnr.posix.util.PlatformTest
Running jnr.posix.util.DefaultPOSIXHandlerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.328 sec - in jnr.posix.util.DefaultPOSIXHandlerTest
Running jnr.posix.JavaFileStatTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in jnr.posix.JavaFileStatTest
Running jnr.posix.GroupTest
Successfully loaded native POSIX impl.
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.287 sec - in jnr.posix.GroupTest
Running jnr.posix.ProcessTest
Successfully loaded native POSIX impl.
Tests run: 8, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 0.3 sec <<< FAILURE! - in jnr.posix.ProcessTest
testGetRLimitPreallocatedRlimit(jnr.posix.ProcessTest)  Time elapsed: 0.258 sec  <<< FAILURE!
java.lang.AssertionError: Bad soft limit for number of processes
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at jnr.posix.ProcessTest.testGetRLimitPreallocatedRlimit(ProcessTest.java:66)

testGetRLimitPointer(jnr.posix.ProcessTest)  Time elapsed: 0.024 sec  <<< FAILURE!
java.lang.AssertionError: Bad soft limit for number of processes
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at jnr.posix.ProcessTest.testGetRLimitPointer(ProcessTest.java:83)

testGetRLimit(jnr.posix.ProcessTest)  Time elapsed: 0 sec  <<< FAILURE!
java.lang.AssertionError: Bad soft limit for number of processes
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at jnr.posix.ProcessTest.testGetRLimit(ProcessTest.java:49)

Running jnr.posix.SpawnTest
Successfully loaded native POSIX impl.
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.31 sec - in jnr.posix.SpawnTest
Running jnr.posix.SignalTest
Successfully loaded native POSIX impl.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.297 sec - in jnr.posix.SignalTest
Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.461 sec - in jnr.posix.FileTest
Running jnr.posix.DTableSizeTest
Running jnr.posix.IDTest
Successfully loaded native POSIX impl.
Successfully loaded native POSIX impl.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.27 sec - in jnr.posix.DTableSizeTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.285 sec - in jnr.posix.IDTest
Running jnr.posix.LinuxPOSIXTest
Running jnr.posix.FileStatTest
Successfully loaded native POSIX impl.
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.307 sec - in jnr.posix.FileStatTest
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by jnr.posix.util.FieldAccess (file:/home/test/jnr-posix/target/classes/) to field java.io.FileDescriptor.fd
WARNING: Please consider reporting this to the maintainers of jnr.posix.util.FieldAccess
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.335 sec <<< FAILURE! - in jnr.posix.LinuxPOSIXTest
testMessageHdrMultipleControl(jnr.posix.LinuxPOSIXTest)  Time elapsed: 0.034 sec  <<< FAILURE!
java.lang.AssertionError: expected:<2> but was:<1>
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.failNotEquals(Assert.java:835)
        at org.junit.Assert.assertEquals(Assert.java:647)
        at org.junit.Assert.assertEquals(Assert.java:633)
        at jnr.posix.LinuxPOSIXTest.testMessageHdrMultipleControl(LinuxPOSIXTest.java:143)

Running jnr.posix.NlLanginfoTest
Successfully loaded native POSIX impl.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.314 sec - in jnr.posix.NlLanginfoTest

Results :

Failed tests:
  LinuxPOSIXTest.testMessageHdrMultipleControl:143 expected:<2> but was:<1>
  ProcessTest.testGetRLimit:49 Bad soft limit for number of processes
  ProcessTest.testGetRLimitPointer:83 Bad soft limit for number of processes
  ProcessTest.testGetRLimitPreallocatedRlimit:66 Bad soft limit for number of processes

Tests run: 101, Failures: 4, Errors: 0, Skipped: 1

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.428 s
[INFO] Finished at: 2023-05-10T07:19:16Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project jnr-posix: There are test failures.
[ERROR]
[ERROR] Please refer to /home/test/jnr-posix/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

These test failures have been observed on both UBI 8.7 and Ubuntu distributions. I kindly request your assistance in investigating these issues.

Steps to reproduce the error:

  1. sudo yum update -y
  2. sudo yum install -y git wget java-11-openjdk-devel tar
  3. export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
  4. export PATH=$JAVA_HOME/bin:$PATH
  5. java -version
  6. cd $HOME_DIR
  7. MAVEN_VERSION=3.8.8
  8. wget https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
  9. tar xzf apache-maven-${MAVEN_VERSION}-bin.tar.gz
  10. export PATH=$HOME_DIR/apache-maven-${MAVEN_VERSION}/bin:${PATH}
  11. export M2_HOME=$HOME_DIR/apache-maven-${MAVEN_VERSION}
  12. cd $HOME_DIR
  13. git clone https://github.com/jnr/jnr-posix.git
  14. cd jnr-posix
  15. git checkout jnr-posix-3.1.16
  16. mvn clean package -DskipTests
  17. mvn test
@pooja0805
Copy link
Author

@headius Could you please have a look at this issue?

@headius
Copy link
Member

headius commented May 23, 2023

This appear to be ok on Java 8 but failing on Java 17+, probably due to module changes preventing reflective access to things the tests need to access (FileDescriptor internals, for example). The tests should be modified to open up the necessary classes by passing --add-opens into the Maven surefire task.

Could be a nice PR, want to try it?

@pooja0805
Copy link
Author

@headius Thank you for your suggestion. It's interesting to note that the error mentioned above is not limited to Java 11 but also occurs with Java 8.

@pooja0805
Copy link
Author

@headius Could you please provide your insights on this matter?

@headius
Copy link
Member

headius commented Sep 12, 2023

I have still been unable to reproduce this. Perhaps you could put together a container image that reproduces it and I can try running that locally?

All tests pass for me on Fedora Linux on x86_64.

@pooja0805
Copy link
Author

I have still been unable to reproduce this. Perhaps you could put together a container image that reproduces it and I can try running that locally?

All tests pass for me on Fedora Linux on x86_64.

Sorry for the late response. Sure I can create a container image and share with you the link to pull that image.

Thanks.

@headius
Copy link
Member

headius commented Jul 30, 2024

@pooja0805 Great, I will watch for it!

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

No branches or pull requests

2 participants