From: Jonathan Rajotte Date: Thu, 16 Jul 2015 14:55:37 +0000 (-0400) Subject: Test for queued task size X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7260dcd9f53e13551542b63d4bf79e8bc02a2eab;p=lttng-ci.git Test for queued task size --- diff --git a/dsl/kernel-lttng-modules.seed.groovy b/dsl/kernel-lttng-modules.seed.groovy index e3ee3f0..b551e16 100644 --- a/dsl/kernel-lttng-modules.seed.groovy +++ b/dsl/kernel-lttng-modules.seed.groovy @@ -288,12 +288,15 @@ hudson.model.Hudson.instance.nodes.each { node -> println "Nb of live kernel enabled build node "+ kernelEnabledNode def ongoingBuild = [] +def queueInstance = Jenkins.instance.queue + while (toBuild.size() != 0) { if(ongoingBuild.size() <= (kernelEnabledNode.intdiv(2))) { def job = toBuild.pop() ongoingBuild.push(job.scheduleBuild2(0)) println "\\t trigering" + HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName) + println "Debug: currenlty queued task" + queueInstance.items.size() } else { Thread.sleep(random.nextInt(120000)) ongoingBuild.removeAll{ it.isCancelled() || it.isDone() }