Skip to content

Commit 5bbadc2

Browse files
committed
test: await cancelled tasks in child run limit tests
1 parent ae4a0f6 commit 5bbadc2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎tests/unit/actor/test_actor_child_runs.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ async def test_child_run_recorded_by_an_earlier_attempt_counts_toward_the_limit(
777777
second_task = asyncio.create_task(start_child(registry, client, 'second', statuses))
778778
await assert_waiting(second_task)
779779
second_task.cancel()
780+
with pytest.raises(asyncio.CancelledError):
781+
await second_task
780782

781783

782784
async def test_child_run_that_cannot_be_fetched_does_not_block_the_limit() -> None:
@@ -881,6 +883,7 @@ async def test_concurrent_named_starts_respect_the_limit() -> None:
881883
await asyncio.sleep(0.05)
882884
for task in tasks:
883885
task.cancel()
886+
await asyncio.gather(*tasks, return_exceptions=True)
884887

885888
assert sum(task.cancelled() for task in tasks) == 1
886889
assert len(statuses) == 2

0 commit comments

Comments
 (0)