How does intellij do it internally when running all unit tests?

已回答

I wonder if intellij uses 1 thread per class or runs all tests in 1 thread.

0

Hello, it depends on the test, but by default it runs in a single thread, that's the general case for JUnit & TestNG.

But you may write your own parallel runner or use provided by JUnit/TestNG:
https://junit.org/junit5/docs/snapshot/user-guide/#writing-tests-parallel-execution
https://testng.org/doc/documentation-main.html#parallel-running

IDEA then would show the output of the parallel running tests. Pls check https://youtrack.jetbrains.com/issue/IDEA-47103, it also has a link for a 3rd party plugin which can help with parallel execution.

0

请先登录再写评论。