Running JUnit Tests in Parallel in IntelliJ IDEA

UPDATE in 2022: This plugin lets you run and debug tests in parallel in IntelliJ IDEA with JUnit4, JUnit5 and TestNG: https://plugins.jetbrains.com/plugin/16229-unit-test-parallel-runner


If you are using JUnit4, you can give this plugin a try: https://plugins.jetbrains.com/plugin/12959-junit4-parallel-runner

Running tests in parallel is as easy as clicking on the green triangle next to a

  • class -> all the test methods in the class are run in parallel
  • package -> all the classes in the package are run in parallel

IDEA will understand parallel JUnit tests only since version 10.

There is a tracker issue which you can vote for and watch for progress: http://youtrack.jetbrains.net/issue/IDEA-47103

We plan to add it in IDEA 10, but the priority would depend on the number of votes.


Answering late for posterity.

You can make JUnit tests run in parallel (or serial) to any level of granularity in IntelliJ by changing the Fork mode in the test's run configuration.

Be careful not to confuse this with the Allow parallel run option, which lets you start the test execution multiple times within your IDE.

To specify the parallelization of a JUnit test (or group of tests) in IntelliJ, open the Run Configuration for that test and change the Fork mode setting or the Allow parallel run setting. This image depicts IntelliJ IDEA 2018.3.4