From cf56d8f5815064c9d59908e9db062f2daedaf849 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 2 Dec 2021 11:10:18 -0500 Subject: [PATCH] Accept multierr on racy teardown discovery tests --- tests/test_discovery.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_discovery.py b/tests/test_discovery.py index 2b2996f..a3c6570 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -206,7 +206,8 @@ def test_subactors_unregister_on_cancel( """Verify that cancelling a nursery results in all subactors deregistering themselves with the arbiter. """ - with pytest.raises(KeyboardInterrupt): + # multi-error since there might be a channel breakage race? + with pytest.raises((KeyboardInterrupt, trio.MultiError)): trio.run( partial( spawn_and_check_registry, @@ -231,7 +232,7 @@ def test_subactors_unregister_on_cancel_remote_daemon( deregistering themselves with a **remote** (not in the local process tree) arbiter. """ - with pytest.raises(KeyboardInterrupt): + with pytest.raises((KeyboardInterrupt, trio.MultiError)): trio.run( partial( spawn_and_check_registry,