You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rm...@apache.org on 2020/04/25 15:31:44 UTC

[maven-surefire] branch SUREFIRE-1781 created (now a71e86a)

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

rmannibucau pushed a change to branch SUREFIRE-1781
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git.


      at a71e86a  logging a warning if forkcount=0

This branch includes the following new commits:

     new a71e86a  logging a warning if forkcount=0

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-surefire] 01/01: logging a warning if forkcount=0

Posted by rm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch SUREFIRE-1781
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit a71e86a8f49116140b24aa40eeacf2a828620b2d
Author: Romain Manni-Bucau <rm...@gmail.com>
AuthorDate: Sat Apr 25 17:31:27 2020 +0200

    logging a warning if forkcount=0
---
 .../org/apache/maven/plugin/surefire/AbstractSurefireMojo.java | 10 ++++++++++
 1 file changed, 10 insertions(+)

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 112de82..8a0cd0a 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
@@ -1121,10 +1121,20 @@ public abstract class AbstractSurefireMojo
             warnIfWrongShutdownValue();
             warnIfNotApplicableSkipAfterFailureCount();
             warnIfIllegalTempDir();
+            warnIfForkCountIsZero();
         }
         return true;
     }
 
+    private void warnIfForkCountIsZero()
+    {
+        if ( "0".equals( getForkCount() ) )
+        {
+            getConsoleLogger().warning( "The parameter forkCount should likely not be 0, not forking a JVM for tests "
+                + "reduce test accuracy, ensure to have a <forkCount> >= 1." );
+        }
+    }
+
     private void executeAfterPreconditionsChecked( @Nonnull DefaultScanResult scanResult )
         throws MojoExecutionException, MojoFailureException
     {