Skip to content

Commit 615523c

Browse files
committed
Anticipate random scheduling
1 parent 0a6e87e commit 615523c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tenacity/tests/test_asyncio.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ def after(retry_state):
7676

7777
await asyncio.gather(
7878
_retryable_coroutine.retry_with(after=after)(thing1),
79-
_retryable_coroutine.retry_with(after=after)(thing2))
79+
_retryable_coroutine.retry_with(after=after)(thing2))
8080

8181
# There's no waiting on retry, only a wait in the coroutine, so the
8282
# executions should be interleaved.
83-
thing1_attempts = attempts[::2]
84-
things1, attempt_nos1 = zip(*thing1_attempts)
85-
assert all(thing is thing1 for thing in things1)
83+
even_thing_attempts = attempts[::2]
84+
things, attempt_nos1 = zip(*even_thing_attempts)
85+
assert len(set(things)) == 1
8686
assert list(attempt_nos1) == [1, 2, 3]
8787

88-
thing2_attempts = attempts[1::2]
89-
things2, attempt_nos2 = zip(*thing2_attempts)
90-
assert all(thing is thing2 for thing in things2)
88+
odd_thing_attempts = attempts[1::2]
89+
things, attempt_nos2 = zip(*odd_thing_attempts)
90+
assert len(set(things)) == 1
9191
assert list(attempt_nos2) == [1, 2, 3]
9292

9393

0 commit comments

Comments
 (0)