[java-idp-integration-tests] 01/02: Workaround Maven Surefire Plugin issue

Tom Zeller tzeller at dragonacea.biz
Sun Dec 17 23:23:38 UTC 2023


This is an automated email from the git hooks/post-receive script.

tzeller pushed a commit to branch main
in repository java-idp-integration-tests.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=540d325f1683c8e22eacea7595b124a61805a66a

commit 540d325f1683c8e22eacea7595b124a61805a66a
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Sun Dec 17 17:18:11 2023 -0600

    Workaround Maven Surefire Plugin issue
    
    For Jetty 10 only.
    
    The Maven Surefire Plugin appears to freeze the JVM when running the
    integration tests with Jetty 10.
    
    Relevant issue is here :
    https://issues.apache.org/jira/browse/SUREFIRE-1881
    
    Apparently the JVM hangs if anything writes to stdout or stderr in the
    Java Process used to start Jetty.
---
 .../net/shibboleth/idp/integration/tests/AbstractServerProcess.java | 4 ----
 .../net/shibboleth/idp/integration/tests/BaseIntegrationTest.java   | 6 ++++++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/test/java/net/shibboleth/idp/integration/tests/AbstractServerProcess.java b/src/test/java/net/shibboleth/idp/integration/tests/AbstractServerProcess.java
index fe83d74..3c86a34 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/AbstractServerProcess.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/AbstractServerProcess.java
@@ -19,7 +19,6 @@ package net.shibboleth.idp.integration.tests;
 
 import java.io.File;
 import java.io.IOException;
-import java.lang.ProcessBuilder.Redirect;
 import java.net.ConnectException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -308,9 +307,6 @@ public class AbstractServerProcess extends AbstractInitializableComponent implem
             fileToStartServer.setExecutable(true);
 
             final Stopwatch stopwatch = Stopwatch.createStarted();
-            // Workaround Maven Surefire Plugin freeze if Jetty 10 writes to stdout or stderr
-            processBuilder.redirectOutput(Redirect.INHERIT);
-            processBuilder.redirectError(Redirect.INHERIT);
             log.debug("Starting the server process");
             process = processBuilder.start();
             waitForStatusPage();
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
index 5c82d02..0a80c9f 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/BaseIntegrationTest.java
@@ -21,6 +21,7 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.lang.ProcessBuilder.Redirect;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
@@ -1083,6 +1084,11 @@ public abstract class BaseIntegrationTest {
         server.setStatusPageURL(getBaseURL() + StatusTest.statusPath);
         server.setShutdownPort(shutdownPort);
         server.initialize();
+        if (jettyVersion.startsWith("10")) {
+            // Workaround Maven Surefire Plugin freeze if Jetty 10 writes to stdout or stderr
+            server.getProcessBuilder().redirectOutput(Redirect.INHERIT);
+            server.getProcessBuilder().redirectError(Redirect.INHERIT);
+        }
         server.start();
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list