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/02/09 08:25:02 UTC

[maven-surefire] branch SUREFIRE-1945-2223 updated (fd9eaea -> fbfd827)

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

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


 discard fd9eaea  [SUREFIRE-1945] crashed tests - unit tests with large logging output does not produce surefire report
     new fbfd827  [SUREFIRE-1945] crashed tests - unit tests with large logging output does not produce surefire report

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   (fd9eaea)
            \
             N -- N -- N   refs/heads/SUREFIRE-1945-2223 (fbfd827)

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:
 .../plugin/surefire/booterclient/output/ThreadedStreamConsumer.java   | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

[maven-surefire] 01/01: [SUREFIRE-1945] crashed tests - unit tests with large logging output does not produce surefire report

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

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

commit fbfd82729fc2a538d08714c8a48b769fb4cbc75d
Author: tibor.digana <ti...@apache.org>
AuthorDate: Wed Feb 9 03:30:03 2022 +0100

    [SUREFIRE-1945] crashed tests - unit tests with large logging output does not produce surefire report
---
 .../surefire/booterclient/output/ThreadedStreamConsumer.java  |  8 ++++++--
 .../java/org/apache/maven/surefire/booter/ForkedBooter.java   | 11 ++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
index 093c191..820ecf3 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumer.java
@@ -136,17 +136,21 @@ public final class ThreadedStreamConsumer
     public void close()
             throws IOException
     {
-        if ( stop.compareAndSet( false, true ) )
+        if ( !stop.get() )
         {
-            items.clear();
             try
             {
                 items.put( END_ITEM );
+                thread.join();
             }
             catch ( InterruptedException e )
             {
                 currentThread().interrupt();
             }
+            finally
+            {
+                stop.set( true );
+            }
         }
 
         if ( pumper.hasErrors() )
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
index 580132a..3593aa7 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
@@ -43,9 +43,8 @@ import java.util.concurrent.Semaphore;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import static java.lang.Math.max;
 import static java.lang.Thread.currentThread;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
 import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_BYE;
 import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_ERROR;
@@ -69,7 +68,6 @@ public final class ForkedBooter
 {
     private static final long DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS = 30L;
     private static final long PING_TIMEOUT_IN_SECONDS = 30L;
-    private static final long ONE_SECOND_IN_MILLIS = 1000L;
     private static final String LAST_DITCH_SHUTDOWN_THREAD = "surefire-forkedjvm-last-ditch-daemon-shutdown-thread-";
     private static final String PING_THREAD = "surefire-forkedjvm-ping-";
 
@@ -331,8 +329,7 @@ public final class ForkedBooter
         );
         encodeAndWriteToOutput( ( (char) BOOTERCODE_BYE ) + ",0,BYE!\n" );
         launchLastDitchDaemonShutdownThread( 0 );
-        long timeoutMillis = max( systemExitTimeoutInSeconds * ONE_SECOND_IN_MILLIS, ONE_SECOND_IN_MILLIS );
-        acquireOnePermit( barrier, timeoutMillis );
+        acquireOnePermit( barrier );
         cancelPingScheduler();
         commandReader.stop();
         System.exit( 0 );
@@ -431,11 +428,11 @@ public final class ForkedBooter
         return pluginProcessChecker != null && pluginProcessChecker.canUse();
     }
 
-    private static boolean acquireOnePermit( Semaphore barrier, long timeoutMillis )
+    private static boolean acquireOnePermit( Semaphore barrier )
     {
         try
         {
-            return barrier.tryAcquire( timeoutMillis, MILLISECONDS );
+            return barrier.tryAcquire( Long.MAX_VALUE, NANOSECONDS );
         }
         catch ( InterruptedException e )
         {