Commit 14947dbc authored by Iustin Pop's avatar Iustin Pop
Browse files

Switch burnin to cli.JobExecutor

Burnin has a custom job executor, because of its need to retry some job

While we cannot replace all of it, at least the execution we can switch
to cli.JobExecutor, to take advantage of the recently-introduced
out-of-order waiting.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 919ca415
...@@ -385,18 +385,19 @@ class Burner(object): ...@@ -385,18 +385,19 @@ class Burner(object):
""" """
self.ClearFeedbackBuf() self.ClearFeedbackBuf()
job_ids = [cli.SendJob(row[0], for row in jobs] jex = cli.JobExecutor(, feedback_fn=self.Feedback)
Log("Submitted job ID(s) %s", utils.CommaJoin(job_ids), indent=1) for ops, name in jobs:
results = [] jex.QueueJob(name, *ops) # pylint: disable-msg=W0142
for jid, (_, iname) in zip(job_ids, jobs):
Log("waiting for job %s for %s", jid, iname, indent=2)
try: try:
results.append(cli.PollJob(jid,, feedback_fn=self.Feedback)) results = jex.GetResults()
except Exception, err: # pylint: disable-msg=W0703 except Exception, err: # pylint: disable-msg=W0703
Log("Job for %s failed: %s", iname, err) Log("Jobs failed: %s", err)
if len(results) != len(jobs):
raise BurninFailure() raise BurninFailure()
return results
if utils.any(results, lambda x: not x[0]):
raise BurninFailure()
return [i[1] for i in results]
def ParseOptions(self): def ParseOptions(self):
"""Parses the command line options. """Parses the command line options.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment