question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameters threadCount and parallel doesn't work with maven

See original GitHub issue

TestMultithreading_v.0.2.zip

Related issues:

https://github.com/cbeust/testng/issues/419 threadCount parameter does not work with ant script

https://github.com/cbeust/testng/pull/936 Fix issue #419: parallel mode was ignored with command line

https://groups.google.com/forum/#!topic/testng-users/kRmLWw6ts0U

Version TestNG: 6.9.11-SNAPSHOT Surefire: 2.19

When I try to set parallel and threadCount via surefire plugin TestNG doesn’t accept values. Tried both:

<configuration>                    
    <parallel>tests</parallel>
    <threadCount>3</threadCount>
</configuration>
<property>
    <name>tests</name>
    <value>classes</value>
</property>
<property>
    <name>threadCount</name>
    <value>3</value>
</property>

See detailed example in attached project: TestMultithreading_v.0.2.zip

Additional info: If I set this parameters in TestSuite.xml file it works fine.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Tibor17commented, Feb 26, 2016

These two configurations are compatible. They are applicable if and only if you do not use <suiteXmlFiles/> in Surefire/Failsafe plugin. This means this configuration works fine if you have only ordinal tests without suites.xml. If you use suites.xml then do not use this configuration and tie to configuration in suites.xml or dataproviderthreadcount and parallel, or annotations in your java code. For more information see our documentation http://maven.apache.org/surefire/maven-surefire-plugin/examples/testng.html or our integration tests which is highly recommended. It’s easy to find those *IT.java files using testng dependency in POM: https://github.com/apache/maven-surefire/tree/master/surefire-integration-tests/src/test/resources If there is anything which needs better documentation please let me know.

<configuration>                    
    <parallel>classes</parallel>
    <threadCount>3</threadCount>
</configuration>
<property>
    <name>parallel</name>
    <value>classes</value>
</property>
<property>
    <name>threadCount</name>
    <value>3</value>
</property>
0reactions
krmahadevancommented, Oct 11, 2017

@juherr - My bad for jumping the gun there ! I have identified the problem. Will send in a PR soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven Surefire Plugin – Fork Options and Parallel Test ...
The parameters useUnlimitedThreads and threadCount are to be interpreted in the context of the value specified for the parallel parameter.
Read more >
maven - surefire-plugin does not respect threadCount parameter
I've split the test execution in two parts. The first one should run the tests that can be parallelize. The second part should...
Read more >
Using command line arguments to maven to set parallel and ...
I'd like to be able to set the parallel and thread-count attributes values from commandline so I can control these values at the...
Read more >
Surefire parallel tests - Rafaela Azevedo
The parameter forkCount defines the maximum number of JVM processes that Surefire will spawn concurrently to execute the tests. It supports the same...
Read more >
Running JUnit Tests in Parallel with Maven - Baeldung
A quick tutorial to running parallel tests using JUnit and Maven, ... However, even tests that don't declare an explicit test runner work, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found