Properly wait for workers when test run terminates early (#963)
Currently, a reason to terminate early (e.g. test failure with --exitfail option set) causes DSession to immediately raise an Interrupt exception. Subsequent reports generated by the workers, during the shutdown phase, are discarded. One consequence is that, for the failing test, teardown and testfinish are ignored, which prevents corresponding hooks pytest_runtest_logreport and pytest_runtest_logfinish being executed for the failing test (this problem covered in #54). The reporting of tests executing in other workers is also left in an indeterminate state. This can affect other plugin code. This is a relatively simple fix, which appears to have minimal and, I think, acceptable impact on text execution behaviour. The observable differences are differences in what is reported about a test run. For example, when running, for example with the '-x/--exitfail' option, it is possible that more than a single test failure is reported. This is because more than one test did fail before the test run was completely stopped. The reporting is absolutely correct; and complete. Prior to this change, only a single failure would have been reported, but because of incomplete and arguably incorrect reporting.
This commit is contained in:
5
changelog/963.improvement.rst
Normal file
5
changelog/963.improvement.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
Wait for workers to finish reporting when test run stops early.
|
||||
|
||||
This makes sure that the results of in-progress tests are displayed.
|
||||
Previously these reports were being discarded, losing information about the
|
||||
test run.
|
||||
Reference in New Issue
Block a user