1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-19 04:21:17 +00:00

fw/execution: implement abnormal job status signals

Implement signals for failed/aborted jobs.
This commit is contained in:
Sergei Trofimov 2018-05-29 11:36:05 +01:00 committed by Marc Bonnici
parent e90b12e984
commit 2cad2dbb10

View File

@ -614,12 +614,14 @@ class Runner(object):
'Max retries exceeded.'
self.logger.error(msg.format(job.id, job.iteration, job.status))
self.context.failed_jobs += 1
self.send(signal.JOB_FAILED)
else: # status not in retry_on_status
self.logger.info('Job completed with status {}'.format(job.status))
if job.status != 'ABORTED':
self.context.successful_jobs += 1
else:
self.context.failed_jobs += 1
self.send(signal.JOB_ABORTED)
def retry_job(self, job):
retry_job = Job(job.spec, job.iteration, self.context)
@ -627,6 +629,7 @@ class Runner(object):
retry_job.retries = job.retries + 1
retry_job.set_status(Status.PENDING)
self.context.job_queue.insert(0, retry_job)
self.send(signal.JOB_RESTARTED)
def send(self, s):
signal.send(s, self, self.context)