diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java index 144ab702..56f523fd 100644 --- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java +++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java @@ -30,6 +30,8 @@ import org.mvndaemon.mvnd.client.ExecutionResult; import org.mvndaemon.mvnd.common.Environment; import org.mvndaemon.mvnd.common.logging.ClientOutput; +import static org.mvndaemon.mvnd.junit.TestUtils.augmentArgs; + public class JvmTestClient extends DefaultClient { private final DaemonParameters parameters; @@ -47,7 +49,7 @@ public class JvmTestClient extends DefaultClient { if (parameters instanceof TestParameters && ((TestParameters) parameters).isNoTransferProgress()) { argv.add("-ntp"); } - final ExecutionResult delegate = super.execute(output, argv); + final ExecutionResult delegate = super.execute(output, augmentArgs(argv)); if (output instanceof TestClientOutput) { return new JvmTestResult(delegate, ((TestClientOutput) output).messagesToString()); } diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java index 6325282e..7391b6e9 100644 --- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java +++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java @@ -35,6 +35,8 @@ import org.mvndaemon.mvnd.common.Message; import org.mvndaemon.mvnd.common.OsUtils.CommandProcess; import org.mvndaemon.mvnd.common.logging.ClientOutput; +import static org.mvndaemon.mvnd.junit.TestUtils.augmentArgs; + /** * A wrapper around the native executable. */ @@ -66,7 +68,8 @@ public class NativeTestClient implements Client { public ExecutionResult execute(ClientOutput output, List args) throws InterruptedException { final List cmd = new ArrayList<>(args.size() + 6); cmd.add(mvndNativeExecutablePath.toString()); - cmd.addAll(args); + cmd.addAll(augmentArgs(args)); + add(Environment.MVND_DAEMON_STORAGE, cmd, parameters::daemonStorage); add(Environment.MAVEN_REPO_LOCAL, cmd, parameters::mavenRepoLocal); add(Environment.MAVEN_SETTINGS, cmd, parameters::settings); diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestUtils.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestUtils.java index 3004684b..7808d41e 100644 --- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestUtils.java +++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestUtils.java @@ -21,10 +21,25 @@ package org.mvndaemon.mvnd.junit; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; import java.util.Comparator; +import java.util.List; import java.util.stream.Stream; public class TestUtils { + /** + * IT circumvention for JDK transport low timeouts and GH macOS runners networking issues. + * If arguments does not contain settings for timeouts (ie as part of test), they will be + * added to increase timeouts for IT runs. + */ + public static List augmentArgs(List args) { + ArrayList result = new ArrayList<>(args); + if (result.stream().noneMatch(s -> s.contains("aether.transport.http.connectTimeout"))) { + result.add("-Daether.transport.http.connectTimeout=1800000"); + } + // note: def value for requestTimeout=1800000; not setting it as it is fine + return result; + } public static void replace(Path path, String find, String replacement) { try {