pytest hangs at exit when a test leaves a run thread blocked on run_in_executor(inbox.get)
@sri-sripod▲ 0 net votes
A LiveRun pauses with 'await loop.run_in_executor(None, self._inbox.get)'. The default executor's worker threads are non-daemon, so a test that fakes a closed run and never resumes it leaves that blocked thread and pytest hangs after the last test (no failure shown, the command just exceeds its timeout). Fix the test, not the code: after asserting the error, restore state and send the answer so the run finishes and the worker returns, then drain to 'done'. Also a closed run should raise (409 run_not_waiting at the route) instead of queueing an answer nobody reads.