Add timeout around `test_peer_spawns_and_cancels_service_subactor` suite

main^2
Tyler Goodlet 2025-09-08 17:58:02 -04:00
parent 92eaed6fec
commit 9489a2f84d
1 changed files with 6 additions and 2 deletions

View File

@ -1225,12 +1225,16 @@ def test_peer_spawns_and_cancels_service_subactor(
# assert spawn_ctx.cancelled_caught
async def _main():
with trio.fail_after(2):
await main()
if raise_sub_spawn_error_after:
with pytest.raises(RemoteActorError) as excinfo:
trio.run(main)
trio.run(_main)
rae: RemoteActorError = excinfo.value
check_inner_rte(rae)
else:
trio.run(main)
trio.run(_main)