0

I added in my pom.xml the following plugin to run test classes in parallel

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
      <parallel>classes</parallel>
      <threadCount>10</threadCount>
      <systemPropertyVariables>
        <profile.name>${profile.name}</profile.name>
      </systemPropertyVariables>
      <forkCount>1</forkCount>
      <testFailureIgnore>true</testFailureIgnore>
    </configuration>
  </plugin>

And i have

@RunWith(Suite.class)
@Suite.SuiteClasses({
   test_1.class,
   test_2.class
})

when i run it as a junit test it runs sequential not parallel... any help ??

Tito Tito
  • 11
  • 4

1 Answers1

0

<forkCount>1</forkcount> means 1 thread!

The default setting is forkCount=1/reuseForks=true, which means that maven-surefire-plugin creates one new JVM process to execute all tests in one Maven module.

from: https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html#Forked_Test_Execution

To run them in parallel, you should choose a forkCount > 1, and (to be safe) also <reuseForks>false</reuseForks>.

xerx593
  • 12,237
  • 5
  • 33
  • 64
  • i amde what you told me and removed the parallel & thread count tag and still runs in sequential .. any help ? – Tito Tito Jan 24 '19 at 15:14