mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-21 18:18:41 +00:00
framework/execution: fix end_run() on crash
ExecutionContext.end_run() does final updates to the run info in the run output (final status, run duration, etc). This was previously accessed via self.output in the context. Typically, this would correctly resolve to the run output, as there would be no current job. However, in the event of a crash, current_job would be set, and this would resolve to the job output itself, resulting in run info not being updated. Use run_output to avoid this.
This commit is contained in:
parent
60fbd17fab
commit
cec3eaa375
@ -116,13 +116,13 @@ class ExecutionContext(object):
|
||||
else:
|
||||
status = Status.FAILED
|
||||
self.run_state.status = status
|
||||
self.output.status = status
|
||||
self.output.info.end_time = datetime.utcnow()
|
||||
self.output.info.duration = self.output.info.end_time -\
|
||||
self.output.info.start_time
|
||||
self.output.write_info()
|
||||
self.output.write_state()
|
||||
self.output.write_result()
|
||||
self.run_output.status = status
|
||||
self.run_output.info.end_time = datetime.utcnow()
|
||||
self.run_output.info.duration = self.output.info.end_time -\
|
||||
self.output.info.start_time
|
||||
self.run_output.write_info()
|
||||
self.run_output.write_state()
|
||||
self.run_output.write_result()
|
||||
|
||||
def finalize(self):
|
||||
self.tm.finalize()
|
||||
|
Loading…
x
Reference in New Issue
Block a user