Replies: 5 comments 4 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.
-
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