diff --git a/Jenkinsfile b/Jenkinsfile index 70ed80dd049..3161aefb5e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -210,7 +210,7 @@ def generateStages(Map args = [:]) { } def cloud(Map args = [:]) { - node(args.label) { + withNode(args.label) { startCloudTestEnv(name: args.directory, dirs: args.dirs) } withCloudTestEnv() { @@ -225,7 +225,7 @@ def cloud(Map args = [:]) { def k8sTest(Map args = [:]) { def versions = args.versions versions.each{ v -> - node(args.label) { + withNode(args.label) { stage("${args.context} ${v}"){ withEnv(["K8S_VERSION=${v}", "KIND_VERSION=v0.7.0", "KUBECONFIG=${env.WORKSPACE}/kubecfg"]){ withGithubNotify(context: "${args.context} ${v}") { @@ -270,7 +270,7 @@ def target(Map args = [:]) { def directory = args.get('directory', '') def withModule = args.get('withModule', false) def isMage = args.get('isMage', false) - node(args.label) { + withNode(args.label) { withGithubNotify(context: "${context}") { withBeatsEnv(archive: true, withModule: withModule, directory: directory, id: args.id) { dumpVariables() @@ -284,6 +284,16 @@ def target(Map args = [:]) { } } +/** +* This method wraps the node call with some latency to avoid the known issue with the scalabitity in gobld. +*/ +def withNode(String label, Closure body) { + sleep randomNumber(min: 10, max: 200) + node(label) { + body() + } +} + /** * This method wraps all the environment setup and pre-requirements to run any commands. */