Tests with timeout are assigned an empty trace
@@ -1227,6 +1227,13 @@ class TestCaseExecutor:
test_case: The executed test case
result: The execution result
"""
+ if result.timeout:
+ # Tests with a timeout are assigned an empty trace because
+ # the statement that caused the timeout might have polluted the trace.
+ # Could be solved if we make the tracer transactional, i.e., commit traced
+ # information per statement only if that statement executed without timeout.
+ result.execution_trace = ExecutionTrace()
+ else:
result.execution_trace = self._tracer.get_trace()
for observer in self._observers:
observer.after_test_case_execution(test_case, result)
