From cacf7ba8c822eabae0d7c9880df49b0f0d83f9b6 Mon Sep 17 00:00:00 2001 From: nre Date: Wed, 23 Jun 2021 13:38:55 +0200 Subject: [PATCH] Make CLONE_TIMEOUT a value in minutes, not seconds This matches the behavior of the default timeout for scm-steps, which also uses 10 minutes. Thanks to @GordonJess for catching this. --- .../com/lesfurets/jenkins/unit/global/lib/GitSource.groovy | 2 +- .../lesfurets/jenkins/unit/global/lib/SourceRetriever.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/GitSource.groovy b/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/GitSource.groovy index 2e2f94f2..1f9e9dce 100644 --- a/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/GitSource.groovy +++ b/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/GitSource.groovy @@ -26,7 +26,7 @@ class GitSource implements SourceRetriever { .inheritIO() .directory(target) def proc = processBuilder.start() - proc.waitFor(CLONE_TIMEOUT, TimeUnit.SECONDS) + proc.waitFor(CLONE_TIMEOUT_MIN, TimeUnit.MINUTES) proc.exitValue() return [fetch.toURI().toURL()] } diff --git a/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/SourceRetriever.groovy b/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/SourceRetriever.groovy index a64508fe..59464844 100644 --- a/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/SourceRetriever.groovy +++ b/src/main/groovy/com/lesfurets/jenkins/unit/global/lib/SourceRetriever.groovy @@ -5,7 +5,7 @@ import groovy.transform.CompileStatic @CompileStatic interface SourceRetriever { - public static final int CLONE_TIMEOUT = 10 + public static final int CLONE_TIMEOUT_MIN = 10 List retrieve(String repository, String branch, String targetPath) throws IllegalStateException