Skip to content

Update classloading blog with fix update for 47646 #2327

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

Merged
merged 2 commits into from
Jun 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _posts/2025-04-30-test-classloading-rewrite.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ In practice, there have been a few hiccups and we've also discovered some edge c
- *All dev services now start in the JUnit discovery phase*. https://quarkus.io/guides/dev-services[Quarkus Dev Services] are currently started during https://quarkus.io/guides/reaugmentation#what-is-augmentation[the augmentation phase], along with bytecode manipulation and other application initialization steps. With the new testing design, all augmentation happens at the beginning of the test run, during the JUnit discovery phase. This means all Dev Services also start at the beginning of the test run. If several test classes with different Dev Service configuration are augmented before any tests are run, multiple differently-configured Dev Services may be running at the same time. This can cause port conflicts and cross-talk on configuration values. We're hoping to have a https://github.com/quarkusio/quarkus/issues/45785[fix] for this in the next release. As a workaround, splitting conflicting tests into separate projects should fix symptoms.
- *Config access from JUnit conditions*. Using a `ConfigProvider` from a custom JUnit condition will https://github.com/quarkusio/quarkus/issues/47081[trigger a `ServiceConfigurationError`]. The workaround is to set the thread context classloader to `this.getClass().getClassLoader()` before reading config, and then set it back afterwards. This is fixed in 3.23.
- *Nested test issues*. If nested `@QuarkusTest` tests are mixed in the same project with plain tests, the plain tests https://github.com/quarkusio/quarkus/issues/47657[will not be able to access Quarkus config], because the thread context classloader does not get correctly reset. As a workaround, you can manually set the thread context classloader to the system classloader in the plain tests. The nested tests also https://github.com/quarkusio/quarkus/issues/47671[have problems in dev mode]. Most of these issues are fixed in 3.23, and the remaining cases are sorted out in 3.24.
- *junit-platform.properties* Including a `junit-platform.properties` in a project https://github.com/quarkusio/quarkus/issues/47646[causes problems] for tests using `@QuarkusTest`.
- *junit-platform.properties* Including a `junit-platform.properties` in a project https://github.com/quarkusio/quarkus/issues/47646[causes problems] for tests using `@QuarkusTest`. This is fixed in 3.24, but note that `junit-platform.properties` files can also https://github.com/quarkusio/quarkus/issues/48125[interfere with multi-profile tests]. To register a class orderer, it is best to https://quarkus.io/guides/getting-started-testing#testing_different_profiles[configure the orderer] in the Quarkus application properties.
- *Gradle source sets*. In some cases classes in one gradle source set https://github.com/quarkusio/quarkus/issues/47760[cannot access package-private fields and classes in a different source set]. This causes an `IllegalAccessError`. The workaround is to switch from package-private to public. This is fixed in 3.24.
- *IDE support*. Running `QuarkusTest` tests from the Eclipse IDE is https://github.com/quarkusio/quarkus/issues/47656[more challenging]. Right-clicking and running individual test methods works, and running a whole package also works. But running at the class level gives an error. Similar, in Visual Studio Code, running all tests in a class or package https://github.com/quarkusio/quarkus/issues/48014[will fail], but running individual test methods will work.
- *IDE support*. Running `QuarkusTest` tests from the Eclipse IDE is https://github.com/quarkusio/quarkus/issues/47656[more challenging]. Running a class as a JUnit test gives an error. To workaround, you can individual test methods, or run a whole package also works, or add `-uniqueId [engine:junit-jupiter]/[class:<your.class.name.here>]` to the program arguments in the run configuration. This is fixed in Eclipse 4.37. Similar, in Visual Studio Code, running all tests in a class or package https://github.com/quarkusio/quarkus/issues/48014[will fail], but running individual test methods will work.
- *Increased memory footprint running tests.* For suites using multiple profiles and resources, more heap or metaspace may be needed.


Expand Down
Loading