use start timeout of distribution test as a constant or configurable via sys property (#8492)

Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
This commit is contained in:
Olivier Lamy 2022-08-31 07:42:03 +10:00 committed by GitHub
parent d533040ea7
commit 19ba621406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 46 additions and 46 deletions

View File

@ -52,7 +52,7 @@ public class BadAppTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start("--add-modules=http," + toEnvironment("deploy", env)))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertThat(run1.getExitValue(), is(0));
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ":jetty-" + env + "-test-badinit-webapp:war:" + jettyVersion);
@ -65,7 +65,7 @@ public class BadAppTests extends AbstractJettyHomeTest
int port = distribution.freePort();
try (JettyHomeTester.Run run2 = distribution.start("jetty.http.port=" + port))
{
assertTrue(run2.awaitFor(5, TimeUnit.SECONDS), "Should have exited");
assertTrue(run2.awaitFor(START_TIMEOUT, TimeUnit.SECONDS), "Should have exited");
assertThat("Should have gotten a non-zero exit code", run2.getExitValue(), not(is(0)));
}
}
@ -92,7 +92,7 @@ public class BadAppTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start("--add-modules=http," + toEnvironment("deploy", env)))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertThat(run1.getExitValue(), is(0));
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ":jetty-" + env + "-test-badinit-webapp:war:" + jettyVersion);
@ -135,7 +135,7 @@ public class BadAppTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start("--add-modules=http," + toEnvironment("deploy", env)))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertThat(run1.getExitValue(), is(0));
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ":jetty-" + env + "-test-badinit-webapp:war:" + jettyVersion);

View File

@ -107,7 +107,7 @@ public class CDITests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ".tests:test-jetty-" + env + "-" + implementation + "-cdi-webapp:war:" + jettyVersion);
@ -129,7 +129,7 @@ public class CDITests extends AbstractJettyHomeTest
assertThat(response.getHeaders().get("Server"), containsString("CDI-Demo-org.eclipse.jetty.test"));
run2.stop();
assertTrue(run2.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run2.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
}
}
}

View File

@ -68,12 +68,12 @@ public class DemoModulesTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(5, TimeUnit.SECONDS));
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());
try (JettyHomeTester.Run runListConfig = distribution.start("--list-config"))
{
assertTrue(runListConfig.awaitFor(5, TimeUnit.SECONDS));
assertTrue(runListConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runListConfig.getExitValue());
// Example of what we expect
// jetty.webapp.addServerClasses = org.eclipse.jetty.logging.,${jetty.home.uri}/lib/logging/,org.slf4j.,${jetty.base.uri}/lib/bouncycastle/
@ -114,7 +114,7 @@ public class DemoModulesTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(5, TimeUnit.SECONDS));
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());
String[] argsStart = {
@ -125,7 +125,7 @@ public class DemoModulesTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run runStart = distribution.start(argsStart))
{
assertTrue(runStart.awaitConsoleLogsFor("Started oejs.Server@", 20, TimeUnit.SECONDS));
assertTrue(runStart.awaitConsoleLogsFor("Started oejs.Server@", START_TIMEOUT, TimeUnit.SECONDS));
startHttpClient();
ContentResponse response = client.GET(baseURI + "/dump.jsp");
@ -271,7 +271,7 @@ public class DemoModulesTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(5, TimeUnit.SECONDS));
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());
String[] argsStart = {

View File

@ -71,7 +71,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start("--add-modules=http"))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
int port = distribution.freePort();
@ -84,7 +84,7 @@ public class DistributionTests extends AbstractJettyHomeTest
assertEquals(HttpStatus.NOT_FOUND_404, response.getStatus());
run2.stop();
assertTrue(run2.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run2.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
}
}
}
@ -113,7 +113,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ".demos:jetty-" + env + "-demo-jsp-webapp:war:" + jettyVersion);
@ -171,7 +171,7 @@ public class DistributionTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
// Verify that --create-start-ini works
@ -215,7 +215,7 @@ public class DistributionTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ".demos:jetty-" + env + "-demo-jsp-webapp:war:" + jettyVersion);
@ -266,7 +266,7 @@ public class DistributionTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ".demos:jetty-" + env + "-demo-jsp-webapp:war:" + jettyVersion);
@ -316,7 +316,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
assertTrue(Files.exists(jettyBase.resolve("resources/log4j2.xml")));
@ -372,7 +372,7 @@ public class DistributionTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File webApp = distribution.resolveArtifact("org.eclipse.jetty." + env + ":jetty-" + env + "-test-websocket-client-provided-webapp:war:" + jettyVersion);
@ -429,7 +429,7 @@ public class DistributionTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File webApp = distribution.resolveArtifact("org.eclipse.jetty." + env + ":jetty-" + env + "-test-websocket-client-webapp:war:" + jettyVersion);
@ -499,7 +499,7 @@ public class DistributionTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Path logFile = distribution.getJettyBase().resolve("resources").resolve("jetty-logging.properties");
@ -630,7 +630,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(args))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Files.copy(Paths.get("src/test/resources/log4j2.xml"),
@ -649,7 +649,7 @@ public class DistributionTests extends AbstractJettyHomeTest
assertEquals(HttpStatus.NOT_FOUND_404, response.getStatus());
run2.stop();
assertTrue(run2.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run2.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
}
}
}
@ -670,7 +670,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(args))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Path julConfig = run1.getConfig().getJettyBase().resolve("resources/java-util-logging.properties");
@ -709,7 +709,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(args))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Path jettyBase = run1.getConfig().getJettyBase();
@ -775,7 +775,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Path jettyBase = run1.getConfig().getJettyBase();
@ -830,7 +830,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run2 = distribution.start(args2))
{
assertTrue(run2.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run2.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run2.getExitValue());
int port = distribution.freePort();
@ -867,7 +867,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution1.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Path jettyBase = run1.getConfig().getJettyBase();
@ -890,7 +890,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run2 = distribution2.start(args2))
{
assertTrue(run2.awaitFor(1000, TimeUnit.SECONDS));
assertTrue(run2.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run2.getExitValue());
Path jettyBase = run2.getConfig().getJettyBase();
@ -913,7 +913,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start("--add-modules=unixdomain-http"))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
int maxUnixDomainPathLength = 108;
@ -954,7 +954,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(List.of("--add-modules=http,exec")))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
int port = distribution.freePort();
@ -993,7 +993,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start("--add-module=https,test-keystore,ssl-ini"))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
// Override the property on the command line with the correct password.
@ -1020,7 +1020,7 @@ public class DistributionTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
// Ensure .well-known directory exists.
@ -1083,7 +1083,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run listConfigRun = distribution.start(List.of("--list-modules=deprecated")))
{
assertTrue(listConfigRun.awaitFor(10, TimeUnit.SECONDS));
assertTrue(listConfigRun.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, listConfigRun.getExitValue());
assertTrue(listConfigRun.getLogs().stream().anyMatch(log -> log.contains(description)));
@ -1091,7 +1091,7 @@ public class DistributionTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run run1 = distribution.start(List.of("--add-modules=http,deprecated")))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
assertTrue(run1.getLogs().stream().anyMatch(log -> log.contains("WARN") && log.contains(reason)));

View File

@ -58,7 +58,7 @@ public class DynamicListenerTests
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ".demos:jetty-" + env + "-demo-jetty-webapp:war:" + jettyVersion);

View File

@ -54,7 +54,7 @@ public class GzipModuleTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(5, TimeUnit.SECONDS));
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());
String[] argsStart = {
@ -98,7 +98,7 @@ public class GzipModuleTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(5, TimeUnit.SECONDS));
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());
String[] argsStart = {
@ -143,7 +143,7 @@ public class GzipModuleTests extends AbstractJettyHomeTest
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(5, TimeUnit.SECONDS));
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());
String[] argsStart = {

View File

@ -147,12 +147,12 @@ public class LoggingOptionsTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run installRun = distribution.start(args1))
{
assertTrue(installRun.awaitFor(10, TimeUnit.SECONDS));
assertTrue(installRun.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, installRun.getExitValue());
try (JettyHomeTester.Run listConfigRun = distribution.start("--list-config"))
{
assertTrue(listConfigRun.awaitFor(10, TimeUnit.SECONDS));
assertTrue(listConfigRun.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, listConfigRun.getExitValue());
List<String> rawConfigLogs = new ArrayList<>();

View File

@ -49,7 +49,7 @@ public class OsgiAppTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = distribution.resolveArtifact("org.eclipse.jetty." + env + ":jetty-" + env + "-test-felix-webapp:war:" + jettyVersion);

View File

@ -59,7 +59,7 @@ public class StatsTests extends AbstractJettyHomeTest
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Path webappsDir = distribution.getJettyBase().resolve("webapps");

View File

@ -85,7 +85,7 @@ public abstract class AbstractSessionDistributionTests extends AbstractJettyHome
try (JettyHomeTester.Run run1 = jettyHomeTester.start(argsStart))
{
assertTrue(run1.awaitFor(5, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = jettyHomeTester.resolveArtifact("org.eclipse.jetty." + environment +

View File

@ -164,7 +164,7 @@ public class HazelcastSessionDistributionTests extends AbstractSessionDistributi
};
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File war = distribution.resolveArtifact("org.eclipse.jetty.tests:test-simple-session-webapp:war:" + jettyVersion);

View File

@ -54,7 +54,7 @@ public class OpenIdTests extends AbstractJettyHomeTest
OpenIdProvider openIdProvider = new OpenIdProvider(clientId, clientSecret);
try (JettyHomeTester.Run run1 = distribution.start(args1))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertTrue(run1.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
File webApp = distribution.resolveArtifact("org.eclipse.jetty.ee10:jetty-ee10-test-openid-webapp:war:" + jettyVersion);