1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-02 11:22:41 +01:00

fw/execution: Handle unresponsive targets

If a target error occurs, check whether the target is unresponsive. If
it is, attempt to hard reset it if possible, or gracefully terminate
execution if not.
This commit is contained in:
Sergei Trofimov
2018-02-28 10:24:56 +00:00
committed by Marc Bonnici
parent fdb872d9cd
commit 6fe31d6cad
4 changed files with 40 additions and 15 deletions

View File

@@ -115,6 +115,9 @@ class Job(object):
self.run_time = datetime.utcnow() - start_time
def process_output(self, context):
if not context.tm.is_responsive:
self.logger.info('Target unresponsive; not processing job output.')
return
self.logger.info('Processing output for job {} [{}]'.format(self.id, self.iteration))
if self.status != Status.FAILED:
with signal.wrap('WORKLOAD_RESULT_EXTRACTION', self, context):
@@ -124,11 +127,17 @@ class Job(object):
self.workload.update_output(context)
def teardown(self, context):
if not context.tm.is_responsive:
self.logger.info('Target unresponsive; not tearing down.')
return
self.logger.info('Tearing down job {} [{}]'.format(self.id, self.iteration))
with signal.wrap('WORKLOAD_TEARDOWN', self, context):
self.workload.teardown(context)
def finalize(self, context):
if not context.tm.is_responsive:
self.logger.info('Target unresponsive; not finalizing.')
return
self.logger.info('Finalizing job {} [{}]'.format(self.id, self.iteration))
with signal.wrap('WORKLOAD_FINALIZED', self, context):
self.workload.finalize(context)