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

ClassLoaderTest.testAutoUnloadClassloaders is flaky #91

Open
pgrt opened this issue Feb 17, 2023 · 2 comments
Open

ClassLoaderTest.testAutoUnloadClassloaders is flaky #91

pgrt opened this issue Feb 17, 2023 · 2 comments

Comments

@pgrt
Copy link

pgrt commented Feb 17, 2023

Hello,

On Debian unstable or testing, version 1.11.9 of reflectasm is packaged, and the default JDK is OpenJDK-17.

The build-time test ClassLoaderTest.testAutoUnloadClassloaders fails from time to time (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031480#5 for the complete log), with the message

[ERROR] testAutoUnloadClassloaders(com.esotericsoftware.reflectasm.ClassLoaderTest) Time elapsed: 0.021 s <<< FAILURE!
junit.framework.AssertionFailedError: expected:<3> but was:<2>
at com.esotericsoftware.reflectasm.ClassLoaderTest.testAutoUnloadClassloaders(ClassLoaderTest.java:63)

To reproduce, one can install the Debian libreflectasm-java package, then unpack the source and run (several times for the last line, until it fails):

$ cd test
$ javac -cp /usr/share/java/reflectasm.jar:/usr/share/java/junit4.jar com/esotericsoftware/reflectasm/ClassLoaderTest.java
$ java -cp .:/usr/share/java/junit4.jar:/usr/share/java/reflectasm.jar org.junit.runner.JUnitCore com.esotericsoftware.reflectasm.ClassLoaderTest

I notice the failure happens when initialCount is 1. When it is 0, I get no failure.

Hoping this can help,

Best,

--
Pierre

@NathanSweet
Copy link
Member

The order the tests run can vary each time, which is why initialCount is 1 sometimes and 0 others.

It's possible that reclaimLoaders can't be relied upon. It's likely a flawed test.

@pgrt
Copy link
Author

pgrt commented Feb 17, 2023

Thank you very much for the quick advice on this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants