Skip to content

Commit 0d221fa

Browse files
daniel-mohedanomhlidd
authored andcommitted
Fix dependency resolution retries in MavenSmokeTest (#9142)
1 parent c718be5 commit 0d221fa

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
4141
private static final String JAVAC_PLUGIN_VERSION = Config.get().ciVisibilityCompilerPluginVersion
4242
private static final String JACOCO_PLUGIN_VERSION = Config.get().ciVisibilityJacocoPluginVersion
4343

44-
private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 400
45-
private static final int PROCESS_TIMEOUT_SECS = 120
44+
private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 120
45+
private static final int PROCESS_TIMEOUT_SECS = 60
4646

4747
private static final int DEPENDENCIES_DOWNLOAD_RETRIES = 5
4848

@@ -293,9 +293,13 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
293293
private void retryUntilSuccessfulOrNoAttemptsLeft(List<String> mvnCommand, Map<String, String> additionalEnvVars = [:]) {
294294
def processBuilder = createProcessBuilder(mvnCommand, false, false, [], additionalEnvVars)
295295
for (int attempt = 0; attempt < DEPENDENCIES_DOWNLOAD_RETRIES; attempt++) {
296-
def exitCode = runProcess(processBuilder.start(), DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS)
297-
if (exitCode == 0) {
298-
return
296+
try {
297+
def exitCode = runProcess(processBuilder.start(), DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS)
298+
if (exitCode == 0) {
299+
return
300+
}
301+
} catch (TimeoutException e) {
302+
LOGGER.warn("Failed dependency resolution with exception: ", e)
299303
}
300304
}
301305
throw new AssertionError((Object) "Tried $DEPENDENCIES_DOWNLOAD_RETRIES times to execute $mvnCommand and failed")

0 commit comments

Comments
 (0)