From: Jonathan Rajotte Date: Fri, 10 Jul 2015 13:48:21 +0000 (-0400) Subject: Add wait to reduce busy pooling X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c086345d17ffdf856bc12ddf4c489345b01733e0;p=lttng-ci.git Add wait to reduce busy pooling --- diff --git a/dsl/kernel-lttng-modules.seed.groovy b/dsl/kernel-lttng-modules.seed.groovy index e10d226..d5140a7 100644 --- a/dsl/kernel-lttng-modules.seed.groovy +++ b/dsl/kernel-lttng-modules.seed.groovy @@ -251,8 +251,10 @@ import hudson.model.* import hudson.AbortException import hudson.console.HyperlinkNote import java.util.concurrent.CancellationException +import java.util.Random +Random random = new Random() def jobs = hudson.model.Hudson.instance.items def fail = false def jobStartWith = "dsl-kernel-" @@ -293,6 +295,7 @@ while (toBuild.size() != 0) { ongoingBuild.push(job.scheduleBuild2(0)) println "\\t trigering" + HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName) } else { + wait(random.nextInt(120000) ongoingBuild.removeAll{ it.isCancelled() || it.isDone() } } } @@ -306,8 +309,10 @@ import hudson.model.* import hudson.AbortException import hudson.console.HyperlinkNote import java.util.concurrent.CancellationException +import java.util.Random +Random random = new Random() def jobs = hudson.model.Hudson.instance.items def fail = false def jobStartWith = "JOBPREFIX" @@ -338,6 +343,7 @@ while (toBuild.size() != 0) { ongoingBuild.push(job.scheduleBuild2(0)) println "\\t trigering " + HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName) } else { + wait(random.nextInt(60000) ongoingBuild.removeAll{ it.isCancelled() || it.isDone() } } }