From 7ffc22dec43eb9e6ba8ebf0e6d2cf2c3e526f91c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 29 Nov 2021 12:41:40 -0500 Subject: [PATCH] Add a kbi fast daemon cancel test --- tests/test_cancellation.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_cancellation.py b/tests/test_cancellation.py index a589f8161..07e985dd8 100644 --- a/tests/test_cancellation.py +++ b/tests/test_cancellation.py @@ -501,3 +501,20 @@ async def main(): with pytest.raises(AssertionError): trio.run(main) + + +def test_fast_cancel_when_spawn_task_in_soft_proc_wait_for_daemon( + start_method, +): + async def main(): + with trio.fail_after(2): + async with tractor.open_nursery() as tn: + p = await tn.start_actor( + 'fast_boi', + enable_modules=[__name__], + ) + await p.run(do_nuthin) + raise KeyboardInterrupt + + with pytest.raises(KeyboardInterrupt): + trio.run(main)