Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make pytest fail when tasks are running after a test
When pressing ctrl-c in pytest, prior to this PR, it would hang as wait_for_task_completion would be called in the unwinding of the fixture stack. However, because ctrl-c was pressed, tasks wouldn't be expected to all complete. This PR changes that to assert that all tasks are completed, rather than *waiting* for all tasks to complete. A non-finished task now gives a test error - which is arguably better anyway because it more aggressively flushes out tests that do not perform a complete shutdown. This means that pressing ctrl-C in a pytest leads to an assertion error; when previously it led to a hang. One recently introduced test is fixed to This is part of safe-shutdown work.
- Loading branch information