Skip to content

Fix dependency resolution retries in MavenSmokeTest #9142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class MavenSmokeTest extends CiVisibilitySmokeTest {
private static final String JAVAC_PLUGIN_VERSION = Config.get().ciVisibilityCompilerPluginVersion
private static final String JACOCO_PLUGIN_VERSION = Config.get().ciVisibilityJacocoPluginVersion

private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 400
private static final int PROCESS_TIMEOUT_SECS = 120
private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 120
private static final int PROCESS_TIMEOUT_SECS = 60

private static final int DEPENDENCIES_DOWNLOAD_RETRIES = 5

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