From cec3eaa3751248664b641790959b01c9e83e4f4e Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 22 Feb 2018 09:11:27 +0000 Subject: 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. --- wa/framework/execution.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wa/framework/execution.py b/wa/framework/execution.py index 10a8c548..04b85730 100644 --- a/wa/framework/execution.py +++ b/wa/framework/execution.py @@ -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() -- cgit v1.2.3