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 2020/04/25 18:47:34 UTC
[maven-surefire] branch master updated: [SUREFIRE-1781] Log a
warning if forkCount = 0
This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new 7ebb2be [SUREFIRE-1781] Log a warning if forkCount = 0
7ebb2be is described below
commit 7ebb2be6f08e88dd57b66f9b44bc0d69fbb0ac05
Author: Romain Manni-Bucau <rm...@gmail.com>
AuthorDate: Sat Apr 25 20:47:24 2020 +0200
[SUREFIRE-1781] Log 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
{