Skip to content

Run junit tests in parallel #599

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Programmer-Magnus
Copy link
Contributor

This PR shows how junit can use many cores and threads to run tests in parallel. This make running tests use less wall clock time. This should not be added to benchmarks, because their result are affected by running in parallel.

The relevant junit settings are located in the added file junit-platform.properties.
Present settings let tests use at most half of the available cores while running in parallel.
The present default for classes are to run in one thread (default=SAME_THREAD in properties file).
The annotation @Execution(ExecutionMode.CONCURRENT) was added to CuteNetlibCase.java as an example of how to enable parallel run when it is not on by default. It is possible to make running in parallel the default for all classes by setting default=CONCURRENT in properties file.

If running tests in parallel is a good idea, then the above annotation can be added to all none benchmark tests.
And the properties in the properties file can be modified to suit the project better.

junit documentation:
https://junit.org/junit5/docs/snapshot/user-guide/#writing-tests-parallel-execution

…g junit tests in parallel. Allow tests to use at most half the available cores.

Add annotation to the CuteNetlibCase class to make it run in parallel.
`@Execution(ExecutionMode.CONCURRENT)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant