gh-119121: Fix and test async.staggered.staggered_race (#119173)

This commit is contained in:
Nikita Sobolev 2024-05-20 14:06:50 +03:00 committed by GitHub
parent 357f5a1f73
commit 16b46ebd2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 100 additions and 2 deletions

View file

@ -69,8 +69,7 @@ async def staggered_race(coro_fns, delay, *, loop=None):
exceptions = []
running_tasks = []
async def run_one_coro(
previous_failed: typing.Optional[locks.Event]) -> None:
async def run_one_coro(previous_failed) -> None:
# Wait for the previous task to finish, or for delay seconds
if previous_failed is not None:
with contextlib.suppress(exceptions_mod.TimeoutError):