Replies: 8 comments 10 replies
-
I also encountered the same problem and was wondering what the general suggested solution is. |
Beta Was this translation helpful? Give feedback.
-
Since I'm trying to implement parallelism for the Looking at the source code of the QuarkusTestExtension the quarkus application is a static variable so as far as the test execution is not forked (not a junit5 expert... ) or a custom classloading mechanism is used for each test class (seems not to be supported in junit 5 junit-team/junit5#201) my guess is that running quarkus test specifications in parallel is not supported at the moment. Could someone confirm/deny this guess? |
Beta Was this translation helpful? Give feedback.
-
What you can do is enabling forking in surefire: <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<forkCount>4</forkCount>
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin> Make sure that you've set you ports config to dynamic ports (e.g. |
Beta Was this translation helpful? Give feedback.
-
I did a workaround that solves for my use case. It allows one to have many test classes running in parallel and all test against the same running instance of Quarkus. Our tests went from 15 minutes to 1 minute. No need to have lots of Quarkus instances running. The steps are a bit hackey but work perfectly. The just of it is that Quarkus kicks off a test that in turn uses the JUnit libraries to kick off your actual tests in parallel:
|
Beta Was this translation helpful? Give feedback.
-
I don't think that this is officialy supported and could also cause troubles when using testing profiles. But @geoand @aloubyansky @gsmet and others will know more for sure ;-) |
Beta Was this translation helpful? Give feedback.
-
@geoand and @holly-cummins Quarkus 3.22 has unfortunately broken this workaround as the classloader changes seem to mess with this.
Any thoughts on a workaround to support running junit tests within QuarkusTest so that we have ability to run tests in parallel. Running tests one after the other is a showstopper for us. We have over 1400 tests and most take a few seconds at least as they do blocking calls to services and things. |
Beta Was this translation helpful? Give feedback.
-
Going forward (as in future feature development), it seems like it would be not-unreasonable to have tests in the same profile able to run in parallel, because there wouldn't be port conflicts. The new class orderer could maybe do it, or maybe test profiles could come with a built-in But that would be a future thing. In the short term, the stack trace you're getting almost looks like a simple code error in how Have you got logging enabled? If so, does it work to just disable logging? I assume it's not going to be that easy ... :) |
Beta Was this translation helpful? Give feedback.
-
Thanks @holly-cummins . I'm not sure if this is an issue: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to split ones tests across multiple classes and run them in parallel against one instance of Quarkus?
I've managed to get JUnit ordering working and can run test classes in an order I want, but many of the tests take a long time (they are integration tests and call into Quarkus that then calls into external APIs). So lets say I have 10 test classes annotated with @QuarkusTest - and each one takes say 2min to run. Right now they run one after the other and takes 20 minutes. Can I possibly run all 10 in parallel and hence taking more like 2min (the tests are not CPU bound).
If I use this config:
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.mode.classes.default=concurrent
junit.jupiter.execution.parallel.mode.default=same_thread
Then JUnit tries to start up multiple instances of Quarkus as opposed to using once instance and running the tests in parallel.
Beta Was this translation helpful? Give feedback.
All reactions