I am trying to run the 6 test classes having 6-12 test cases in each test class with the below configuration. But somehow the parallelism is not being achieved so far. Using fork count I am able to do that but more than 1 fork means that multiple processes will be running and every test depends on 1 setUp method(actually this set up method taking much time and want to run only once and then use the returned value thereafter for the next set of test cases) which will be running once and we will use that data to perform. Please help as I don't want to create the new process and instead I want to run by multiple threads only to achieve parallelism.
` <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/stories/**/*.java</include>
</includes>
<excludes>
<exclude>**/stories/Base*.java</exclude>
</excludes>
<testFailureIgnore>true</testFailureIgnore>
<parallel>all</parallel>
<threadCountClasses>2</threadCountClasses>
<threadCountMethods>6</threadCountMethods>
<threadCount>10</threadCount>
<!--<forkCount>3</forkCount>-->
<!--<useUnlimitedThreads>true</useUnlimitedThreads>-->
<perCoreThreadCount>false</perCoreThreadCount>
</configuration>
</plugin>`
I have somehow able to make it parallel. You have to add the below line in the pom.xml,
<argLine>-Xmx1600m</argLine>
This actually help to assign the Java Heap Memory for per thread to operate so that more fork can be spawned in the the same JVM and parallel test cases can be excecuted