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/01/04 05:29:56 UTC

[maven-surefire] branch SUREFIRE-1725 updated (cbf6ce0 -> 60e7bc9)

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

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


 discard cbf6ce0  [SUREFIRE-1725] Surefire in JUnit Vintage mode distributes tests very unevenly between forks, causing poor parallelism
     new 60e7bc9  [SUREFIRE-1725] Surefire in JUnit Vintage mode distributes tests very unevenly between forks, causing poor parallelism

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (cbf6ce0)
            \
             N -- N -- N   refs/heads/SUREFIRE-1725 (60e7bc9)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java | 1 -
 1 file changed, 1 deletion(-)


[maven-surefire] 01/01: [SUREFIRE-1725] Surefire in JUnit Vintage mode distributes tests very unevenly between forks, causing poor parallelism

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

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

commit 60e7bc991ac2a66d4b8fe55b777744777be509f7
Author: tibordigana <ti...@apache.org>
AuthorDate: Sat Jan 4 06:17:07 2020 +0100

    [SUREFIRE-1725] Surefire in JUnit Vintage mode distributes tests very unevenly between forks, causing poor parallelism
---
 .../junitplatform/JUnitPlatformProvider.java         | 20 ++++++++++++++------
 .../surefire/junitplatform/RunListenerAdapter.java   |  1 -
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
index 373a4ca..0e810d3 100644
--- a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
+++ b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java
@@ -149,9 +149,8 @@ public class JUnitPlatformProvider
 
     private void invokeAllTests( TestsToRun testsToRun, RunListener runListener )
     {
-        LauncherDiscoveryRequest discoveryRequest = buildLauncherDiscoveryRequest( testsToRun );
         RunListenerAdapter adapter = new RunListenerAdapter( runListener );
-        launcher.execute( discoveryRequest, adapter );
+        execute( testsToRun, adapter );
         // Rerun failing tests if requested
         int count = parameters.getTestRequest().getRerunFailingTestsCount();
         if ( count > 0 && adapter.hasFailingTests() )
@@ -159,7 +158,7 @@ public class JUnitPlatformProvider
             for ( int i = 0; i < count; i++ )
             {
                 // Replace the "discoveryRequest" so that it only specifies the failing tests
-                discoveryRequest = buildLauncherDiscoveryRequestForRerunFailures( adapter );
+                LauncherDiscoveryRequest discoveryRequest = buildLauncherDiscoveryRequestForRerunFailures( adapter );
                 // Reset adapter's recorded failures and invoke the failed tests again
                 adapter.reset();
                 launcher.execute( discoveryRequest, adapter );
@@ -172,15 +171,24 @@ public class JUnitPlatformProvider
         }
     }
 
-    private LauncherDiscoveryRequest buildLauncherDiscoveryRequest( TestsToRun testsToRun )
+    private void execute( TestsToRun testsToRun, RunListenerAdapter adapter )
     {
         LauncherDiscoveryRequestBuilder builder =
-                        request().filters( filters ).configurationParameters( configurationParameters );
+            request().filters( filters ).configurationParameters( configurationParameters );
+
         for ( Class<?> testClass : testsToRun )
         {
             builder.selectors( selectClass( testClass.getName() ) );
+            if ( !testsToRun.allowEagerReading() )
+            {
+                launcher.execute( builder.build(), adapter );
+            }
+        }
+
+        if ( testsToRun.allowEagerReading() )
+        {
+            launcher.execute( builder.build(), adapter );
         }
-        return builder.build();
     }
 
     private LauncherDiscoveryRequest buildLauncherDiscoveryRequestForRerunFailures( RunListenerAdapter adapter )
diff --git a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java
index bdcca6b..f8fd3bc 100644
--- a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java
+++ b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java
@@ -64,7 +64,6 @@ final class RunListenerAdapter
     public void testPlanExecutionStarted( TestPlan testPlan )
     {
         this.testPlan = testPlan;
-        failures.clear();
     }
 
     @Override