From 7260dcd9f53e13551542b63d4bf79e8bc02a2eab Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 16 Jul 2015 10:55:37 -0400 Subject: [PATCH] Test for queued task size --- dsl/kernel-lttng-modules.seed.groovy | 3 +++ 1 file changed, 3 insertions(+) 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() } -- 2.34.1