Intellij IDEA mode for unit tests slows down

I am running 9 JUnit tests (Spockframework) in Intellij IDEA. It takes about 3 seconds.

I want to use all the kernels, so I switch the test configuration mode fork mode - class. Edit configurations > Fork mode > class

This increases the build time to 8 seconds. Trying to use fork mode is 22 seconds. In addition, the test run process looks as if they are running sequentially, rather than in parallel.

Any ideas on why tests without forking work as expected?

+5
source share
1 answer

Forking simply means that you get a separate process for each test run, but the process will not necessarily be executed in parallel.

From what I saw, the JUnit plugin is not able to run tests in parallel. If you use Gradle, use the maxParallelForks parameter as shown in the docs (and you probably know this, but you can run Gradle tasks directly from IntelliJ).

If you are using Maven, try - t .

+5
source

All Articles