Skip to content

Document configuration parameters for parallel test execution in Jupiter #2946

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

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion documentation/src/docs/asciidoc/user-guide/writing-tests.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,59 @@ behind the scenes may spawn additional threads to ensure execution continues wit
sufficient parallelism. Thus, if you require such guarantees in a test class, please use
your own means of controlling concurrency.

===== Relevant properties

The below table lists out relevant parallel execution properties in `junit-platform.properties`.
[cols="1,2,1,1"]
|===
|Property |Description |Acceptable values |Default value

| ```junit.jupiter.execution.parallel.enabled```
|Enable parallel test exection
a|
* `true`
* `false`
|```false```

| ```junit.jupiter.execution.parallel.mode.default```
|Set execution mode of the nodes in the test tree
a|
* `concurrent`
* `same_thread`
|```same_thread```

| ```junit.jupiter.execution.parallel.mode.classes.default```
|Set execution mode of the top-level classes
a|
* `concurrent`
* `same_thread`
|```same_thread```

| ```junit.jupiter.execution.parallel.config.strategy```
|Set execution strategy for desired parallelism and maximum pool size
a|
* `dynamic`
* `fixed`
* `custom`
| ```dynamic```

| ```junit.jupiter.execution.parallel.config.dynamic.factor```
|Set the factor to be multiplied with the number of available processors/cores to determine the desired parallelism for the dynamic configuration strategy
|Must be a decimal number
| ```1```


| ```junit.jupiter.execution.parallel.config.fixed.parallelism```
|Set the desired parallelism for the fixed configuration strategy
|Must be an integer
|No default value

| ```junit.jupiter.execution.parallel.config.custom.class```
|Specify the fully qualified class name of the ```ParallelExecutionConfigurationStrategy``` to be used for the custom configuration strategy
|for instance ```org.example.CustomStrategy```
|No default value
|===

[[writing-tests-parallel-execution-synchronization]]
==== Synchronization

Expand Down Expand Up @@ -2333,7 +2386,6 @@ to the same shared resource is running.
include::{testDir}/example/SharedResourcesDemo.java[tags=user_guide]
----


[[writing-tests-built-in-extensions]]
=== Built-in Extensions

Expand Down