We've recently upgraded from Maven 2.2.1 to Maven 3.5.3.
We used to run the unit tests for some of our projects/modules using the parallel test functionality in the maven-surefire-plugin. Specifically, we had one module that was configured as follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<argLine>-Xmx5G</argLine>
<failIfNoTests>false</failIfNoTests>
<printSummary>true</printSummary>
<reportFormat>plain</reportFormat>
<parallel>all</parallel>
<useUnlimitedThreads>true</useUnlimitedThreads>
</configuration>
</plugin>
However, since upgrading to Maven 3.5.3, we've found that the build stalls or hangs somewhere in running the unit tests for that module.
Since then, we've also found that if we remove the <parallel>
and <useUnlimitedThreads>
, the build works fine.
Incidentally, it also seems that, with that configuration, whether the unit tests are run in parallel depends on the -T X
parallel build configuration - i.e. if I specify -T 20
, doing a build on that single module seems to run substantially faster than without specifying the parallel build, which may suggest that Maven 3 is using that parallel build configuration to run the tests in parallel - although, that's not what I understood to be the case from the parallel builds documentation.
I've tried various permutations of the maven-surefire-plugin configuration, but none of them in which I include <parallel>
work for that module.
Questions:
Should I be able to run tests with
<parallel>
in Maven 3.5.3?If so, is there any additional configuration that I should be using to get this to work?
Are there any known issues with running tests with
<parallel>
in Maven 3.5.3? (I've done a pretty extensive search for this, but it may be that someone knows of something that I haven't been able to find.)Is there some interaction between maven 3 parallel builds and running tests in parallel?