Closed HerrDerb closed 3 weeks ago
Are you mixing different kind of tests that could explain that sometimes the class is loaded from the app class loader?
Because Surefire won't execute the tests in the same order each time so that could maybe explain that sometimes a different order causes the issue.
One thing you could do to validate this theory would be to force the order of execution, first in one way, and then the other way: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#runOrder (use alphabetical
and then reversealphabetical
).
That might help to pinpoint what's problematic (if the randomness is caused by the order of the tests).
Well, there are plain JUnit and QuarkusTests, if that might be a cause. @gsmet I'll give this a try 👍
/cc @cescoffier (rest-client)
@gsmet Seems the issue was caused by the usage of CompletableFuture.supplyAsync
for which we did not provide a specific executor. Without providing a specific executor, CompletableFuture
uses its own defined executor which is either a simple thread spawner or a ForkJoinPool
.
What exactly the cause is, I still don't know, as it did work for already over a year without problems. Also ordering the test execution after JUnit and Quarkus tests (both orders natural and reverse) did not help.
Describe the bug
Since a while (maybe 3.11.2?) we experience some occasionally classloading issues during execution of tests. When rerunning the test, they eventually run through as expected. The issue always seem to originate in the generated RestClient.
com.acme.shared
is a library I am using in this application.Does this ring any bell?
This might be related to https://github.com/quarkusio/quarkus/issues/41349
How to Reproduce?
As the circumstances are unclear to me, I cannot provide information how to reproduce
Output of
java -version
21
Quarkus version or git rev
3.12.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)gradle