JUnit5: Start containers concurrently
See original GitHub issueWhen using Testcontainers in combination with JUnit5 using @Testcontainers
and @Container
all the containers are started sequentially.
Especially when there are multiple containers involved it could save some time to start them in parallel.
This feature request is about facilitating the concurrent start of containers.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
JUnit 5 Quickstart - Testcontainers for Java
The @Container annotation tells JUnit to notify this field about various events in the test lifecycle. In this case, our rule object is...
Read more >JUnit 5 User Guide
However, both delimiter attributes cannot be set simultaneously. Comments in CSV files. Any line beginning with a # symbol will be interpreted ...
Read more >JUnit 5 tests are executed in parallel inside IntelliJ and locally ...
JUnit 5 tests are executed in parallel inside IntelliJ and locally with Maven, but not inside Maven Docker container on Google Cloud Build....
Read more >Introduction to Testcontainers with JUnit 5 and Spring Boot
Get started with Testcontainers to write integration tests for your Spring Boot application with ease. This tutorial covers a first ...
Read more >JUnit5: Parallelization of Parameterized Tests (Only)
In order to run selected parameterized tests concurrently, ... As presented, it is clear that there were two separate containers spinned up ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s possible to use both
@Container
annotation with a parallel approach. You can implementorg.testcontainers.lifecycle.Startable
interface that would have several containers inside it. Like this:And then just use
@Container ParallelContainers containers
in test classes.Well sorry for long thinking about the problem, maybe it instead could be a flag on
@Container
annotation, so in the https://github.com/testcontainers/testcontainers-java/blob/main/modules/junit-jupiter/src/main/java/org/testcontainers/junit/jupiter/TestcontainersExtension.java, we might split containers into 2 groups every time we have to start it, and as you said start ones with the flag with sample of code like this?