You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2022/01/23 06:07:10 UTC

[maven-surefire] 01/12: SUREFIRE-1398 threadCount is set for JUnit only when it is positive

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch release/2.22.3
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 9df9683ffad7855ec8815005e0a045c8d26262ee
Author: Matous Jobanek <mj...@redhat.com>
AuthorDate: Wed Jul 26 09:47:00 2017 +0200

    SUREFIRE-1398 threadCount is set for JUnit only when it is positive
    
    close #160
    
    (cherry picked from commit 667e16f14938be673f772fde8766157eb9799220)
---
 .../java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 2e912ed..9c08399 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -1401,7 +1401,11 @@ public abstract class AbstractSurefireMojo
         }
 
         getProperties().setProperty( ProviderParameterNames.PARALLEL_PROP, usedParallel );
-        getProperties().setProperty( ProviderParameterNames.THREADCOUNT_PROP, Integer.toString( getThreadCount() ) );
+        if ( this.getThreadCount() > 0 )
+        {
+            getProperties().setProperty( ProviderParameterNames.THREADCOUNT_PROP,
+                                         Integer.toString( getThreadCount() ) );
+        }
         getProperties().setProperty( "perCoreThreadCount", Boolean.toString( getPerCoreThreadCount() ) );
         getProperties().setProperty( "useUnlimitedThreads", Boolean.toString( getUseUnlimitedThreads() ) );
         getProperties().setProperty( ProviderParameterNames.THREADCOUNTSUITES_PROP,