maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [maven-surefire] rmannibucau commented on a change in pull request #305: enable to flush regularly output of the forked process
Date Wed, 08 Jul 2020 12:36:01 GMT

rmannibucau commented on a change in pull request #305:
URL: https://github.com/apache/maven-surefire/pull/305#discussion_r451510317



##########
File path: surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
##########
@@ -129,6 +134,34 @@ private void setupBooter( String tmpDir, String dumpFileName, String
surefirePro
 
         flushEventChannelOnExit();
 
+        final Long outputFlushInterval = providerConfiguration.getOutputFlushInterval();
+        if ( outputFlushInterval != null && outputFlushInterval > 0
+            && LegacyMasterProcessChannelEncoder.class.isInstance( eventChannel )
)
+        {
+            final LegacyMasterProcessChannelEncoder enc = LegacyMasterProcessChannelEncoder.class.cast(
eventChannel );
+            flusher = Executors.newSingleThreadScheduledExecutor( DaemonThreadFactory.newDaemonThreadFactory()
);
+            flusher.scheduleAtFixedRate( new Runnable()
+            {
+                @Override
+                public void run()
+                {
+                    final WritableBufferedByteChannel c = WritableBufferedByteChannel.class.cast(
enc.getOut() );
+                    try
+                    {
+                        if ( c.isOpen() )

Review comment:
       this is a SPI (so user facing) so didn't want to modify it since this is really a workaround
:s




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message