Skip to content

Commit

Permalink
Merge pull request #19472 from cmsbuild/fix-wf-commands
Browse files Browse the repository at this point in the history
make sure that workflow commands are written with all the quotes
  • Loading branch information
smuzaffar committed Jun 29, 2017
2 parents 1974578 + 344ce2a commit 31f9a62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 2 additions & 5 deletions Configuration/PyReleaseValidation/python/MatrixRunner.py
@@ -1,6 +1,4 @@

import os, sys, time
import random

from Configuration.PyReleaseValidation.WorkFlow import WorkFlow
from Configuration.PyReleaseValidation.WorkFlowRunner import WorkFlowRunner
Expand Down Expand Up @@ -56,16 +54,15 @@ def runTests(self, opt):

# make sure we don't run more than the allowed number of threads:
while self.activeThreads() >= self.maxThreads:
time.sleep(10)
continue
time.sleep(1)

print '\nPreparing to run %s %s' % (wf.numId, item)
sys.stdout.flush()
current = WorkFlowRunner(wf,noRun,dryRun,cafVeto, opt.dasOptions, opt.jobReports, opt.nThreads, opt.maxSteps)
self.threadList.append(current)
current.start()
if not dryRun:
time.sleep(random.randint(1,5)) # try to avoid race cond by sleeping random amount of time [1,5] sec
time.sleep(0.5) # try to avoid race cond by sleeping 0.5 sec

# wait until all threads are finished
while self.activeThreads() > 0:
Expand Down
5 changes: 3 additions & 2 deletions Configuration/PyReleaseValidation/python/WorkFlowRunner.py
Expand Up @@ -155,8 +155,9 @@ def closeCmd(i,ID):
cmd+=closeCmd(istep,self.wf.nameId)
retStep = 0
if istep>self.maxSteps:
p = Popen("echo 'step%s:%s' >> %s/wf_steps.txt" % (istep, cmd, self.wfDir), shell=True)
os.waitpid(p.pid, 0)[1]
wf_stats = open("%s/wf_steps.txt" % self.wfDir,"a")
wf_stats.write('step%s:%s\n' % (istep, cmd))
wf_stats.close()
else: retStep = self.doCmd(cmd)

self.retStep.append(retStep)
Expand Down

0 comments on commit 31f9a62

Please sign in to comment.