2

Poorly written unit tests are generally affected by the parallelism in JUnit execution. Can setting the number of threads for JUnit helps?

I read it somewhere, but I'm not sure. Can someone tell how can we set it? And where?

3
  • Can you please rephrase ? Commented Sep 3, 2015 at 12:12
  • possible duplicate of Concurrent JUnit testing Commented Sep 3, 2015 at 12:14
  • 2
    IMHO, by default JUnit does not execute tests in parallel, that's why someone else has written a parallel test runner. Commented Sep 3, 2015 at 12:15

1 Answer 1

3

By defaul jUnit executes @Test methods in 4 threads. Howerver you can increase that number by putting:

junit.jupiter.execution.parallel.config.fixed.parallelism={numberOfThreads}

into:

src/main/resources/junit-platform.properties
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.