Summary
For tests that use tmt-reboot or restart_on_exit_code, the start_time and
end_time fields on the result are silently overwritten on each re-execution of
the test. The final values reflect only the last execution segment (after the
final reboot/restart), not the original start of the test.
Root cause
In tmt/steps/execute/internal.py, the _run_tests loop reuses the same
TestInvocation object across reboots/restarts (via continue without
incrementing the index). Each call to invoke_test() runs a new Stopwatch
and unconditionally overwrites self.start_time and self.end_time on the
invocation:
self.start_time = timer.start_time_formatted
self.end_time = timer.end_time_formatted
Summary
For tests that use
tmt-rebootorrestart_on_exit_code, thestart_timeandend_timefields on the result are silently overwritten on each re-execution ofthe test. The final values reflect only the last execution segment (after the
final reboot/restart), not the original start of the test.
Root cause
In
tmt/steps/execute/internal.py, the_run_testsloop reuses the sameTestInvocationobject across reboots/restarts (viacontinuewithoutincrementing the index). Each call to
invoke_test()runs a newStopwatchand unconditionally overwrites
self.start_timeandself.end_timeon theinvocation: