-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
As described in #46035
Having a QuarkusTest provide config overrides via the TestProfile annotation pollutes the environment of other tests in the suite.
I was able to debug the QuarkusComponentTestExtension and inspect the resolved Config object. Using the org.eclipse.microprofile.config.Config.getConfigValue API, I was able to see that the incorrect config value was coming from system properties (I assume set by the quarkus test extension).
Expected behavior
As described in #46035
I understand the limitation with Quarkus tests and how the Test Profiles work by requiring a test ordering and a restarting of the Quarkus server (which is part of my motivation for wanting to move more of my tests to be QuarkusComponentTests rather than QuarkusTest).
However, it appears the orderer is unaware of QuarkusComponentTests. It would seem the server needs to either restart after the last QuarkusTest with a TestProfile, or QuarkusComponentTests needed to be ordered before QuarkusTests. I encountered this issue when my test order changed on a quarkus upgrade. However, this doesn't appear to be associated with any change to the QuarkusTestProfileAwareClassOrderer.
Previously, there was a workaround available using QuarkusTestProfileAwareClassOrderer
. However, due to #48289 this is not available
I'm really excited by component tests and would like to use them more extensively. However, this bug means I cannot use them in a test suite with other Quarkus tests, which hinders migration efforts
Actual behavior
QuarkusTests with profiles do not close their resources properly still. In addition, the fix that closed the original bug was reverted in #46684.
It seems that the test isolation work did not fix this bug, but rather made it worse by also breaking the way for projects to work around it.
But, based on the description of the PR that reverted this #46684, the issues the new default ordering caused should be mitigated by recent work. I believe the right approach is to re-apply the ordering change and run component tests before quarkus tests.
How to Reproduce?
Reproducer: https://github.com/ryandens/quarkus-component-test-reproducer (updated for Quarkus 3.24.3)
- Clone the project
- Run the build, showing failing tests
Output of uname -a
or ver
No response
Output of java -version
openjdk version "24" 2025-03-18 OpenJDK Runtime Environment Temurin-24+36 (build 24+36) OpenJDK 64-Bit Server VM Temurin-24+36 (build 24+36, mixed mode, sharing)
Quarkus version or git rev
3.24.3
Build tool (ie. output of mvnw --version
or gradlew --version
)
------------------------------------------------------------ Gradle 8.14.3 ------------------------------------------------------------ Build time: 2025-07-04 13:15:44 UTC Revision: e5ee1df3d88b8ca3a8074787a94f373e3090e1db Kotlin: 2.0.21 Groovy: 3.0.24 Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024 Launcher JVM: 24 (Eclipse Adoptium 24+36) Daemon JVM: /Users/ryandens/.sdkman/candidates/java/24-tem (no JDK specified, using current Java home) OS: Mac OS X 15.5 aarch64
Additional information
No response