-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support some level of parallelization in junit-vintage-engine #2229
Comments
thanks, @sarod for rising this. |
Are there any known workarounds to achieve this currently? |
That should be fairly straightforward to implement. Basically, one would have to call junit5/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java Lines 77 to 84 in 3f7fed6
|
This change updates the JUnit Vintage Test Engine to read the parallel configuration parameters, and if parallel execution is enabled, creates a thread pool for executing the test descriptors concurrently. The approach for configuring the thread pool emulates the logic used by the Jupiter Test Engine. Issue: junit-team#2229
This change updates the JUnit Vintage Test Engine to read the parallel configuration parameters, and if parallel execution is enabled, creates a thread pool for executing the test descriptors concurrently. The approach for configuring the thread pool emulates the logic used by the Jupiter Test Engine. Issue: junit-team#2229
This change updates the JUnit Vintage Test Engine to read the parallel configuration parameters, and if parallel execution is enabled, creates a thread pool for executing the test descriptors concurrently. The approach for configuring the thread pool emulates the logic used by the Jupiter Test Engine. Issue: junit-team#2229
This updates the user guide and release notes with details on concurrent test execution. Issue: junit-team#2229
This change updates the JUnit Vintage Test Engine to read the parallel configuration parameters, and if parallel execution is enabled, creates a thread pool for executing the test descriptors concurrently. The approach for configuring the thread pool emulates the logic used by the Jupiter Test Engine. Issue: junit-team#2229
This updates the user guide and release notes with details on concurrent test execution. Issue: junit-team#2229
This addresses code review feedback. The configuration property prefix is now `junit.vintage.execution.parallel`. The user guide reflects this. The `ForkJoinPool` that supports concurrent execution more closely matches the one used by the JUnit platform engine. Lastly code review feedback was incorporated to remove unnecesary or redundant code and to conform better to coding standards. Issue: junit-team#2229
This corrects the asciidoc formatting for the Vintage Parallelization usage guide. Issue: junit-team#2229
This change updates the JUnit Vintage Test Engine to read the parallel configuration parameters, and if parallel execution is enabled, creates a thread pool for executing the test descriptors concurrently. The approach for configuring the thread pool emulates the logic used by the Jupiter Test Engine. Issue: junit-team#2229
This updates the user guide and release notes with details on concurrent test execution. Issue: junit-team#2229
This addresses code review feedback. The configuration property prefix is now `junit.vintage.execution.parallel`. The user guide reflects this. The `ForkJoinPool` that supports concurrent execution more closely matches the one used by the JUnit platform engine. Lastly code review feedback was incorporated to remove unnecesary or redundant code and to conform better to coding standards. Issue: junit-team#2229
This corrects the asciidoc formatting for the Vintage Parallelization usage guide. Issue: junit-team#2229
This commit _attempts_ to fix concurrency unit test failures observed on Windows Server 2019 10.0 amd64 with JVM 15.0.1 (Azul Systems, Inc. 15.0.1+8) and Linux 5.4.0-1031-azure amd64 with JVM 15 (Oracle Corporation 15+36-1562). It does this by using a `CyclicBarrier` to ensure test methods run concurrently when expected to. This is the same logic used by `ParallelExecutionIntegrationTests`. Note, I was not able to reproduce the build failures locally. Issue: junit-team#2229
This change updates the JUnit Vintage Test Engine to read the parallel configuration parameters, and if parallel execution is enabled, creates a thread pool for executing the test descriptors concurrently. The approach for configuring the thread pool emulates the logic used by the Jupiter Test Engine. Issue: junit-team#2229
This updates the user guide and release notes with details on concurrent test execution. Issue: junit-team#2229
This addresses code review feedback. The configuration property prefix is now `junit.vintage.execution.parallel`. The user guide reflects this. The `ForkJoinPool` that supports concurrent execution more closely matches the one used by the JUnit platform engine. Lastly code review feedback was incorporated to remove unnecesary or redundant code and to conform better to coding standards. Issue: junit-team#2229
This corrects the asciidoc formatting for the Vintage Parallelization usage guide. Issue: junit-team#2229
This commit _attempts_ to fix concurrency unit test failures observed on Windows Server 2019 10.0 amd64 with JVM 15.0.1 (Azul Systems, Inc. 15.0.1+8) and Linux 5.4.0-1031-azure amd64 with JVM 15 (Oracle Corporation 15+36-1562). It does this by using a `CyclicBarrier` to ensure test methods run concurrently when expected to. This is the same logic used by `ParallelExecutionIntegrationTests`. Note, I was not able to reproduce the build failures locally. Issue: junit-team#2229
This addresses code review feedback. Specifically, it extracts a factory for creating `ForkJoinPool` instances. It also consolidates the documentation on customising pool creation. Lastly, the unit tests are refactored to simplify future enhancements. Issue: junit-team#2229
Issue: junit-team#2229 Co-authored-by: Marc Philipp <marc@gradle.com>
@marcphilipp As you suggested running test classes in parallel with Vintage Engine is straightforward and the same is working fine. Is there any suggestion for running the test methods from the same class in parallel? I tried the solution mentioned here but it only supports test classes in parallel. |
I might be missing something, but so far as I can tell, it is not possible to run tests in parallel with junit-vintage. At the very least, If implementing the feature is very difficult, it might be nice if junit-vintage looked for |
For anybody else who wants this, I was able to get #2449 working on JitPack, took some tricks, you can use it like so:
Swapping that little dep took a painpoint testsuite from 60 seconds to 10 seconds. |
Goal
Add support for some level of parallelization inside the Junit Vintage engine.
Ideally the level of configuration should be similar to maven surefire parallel options.
Why
When including junit 5 tests in a project containing junit4 tests the natural path is to use junit 5 platform with the jupiter and vintage engines.
However this causes problem with parallelization.
In a project with Junit4 tests only maven surefire level parallelization works fine. (See https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html).
For Junit5 tests the jupiter engine parallel execution works great.
However when a project contains a mix of Junit4 and Junit 5 there is no great way to configure parallelism:
Another option is to configure two distinct test tasks one for junit 4 using surefire parallel and one for junit 5 but it kind of defeats the point of junit platform.
Deliverables
The text was updated successfully, but these errors were encountered: