8000 GH-98388: Add tests for happy eyeballs and its internal workings by twisteroidambassador · Pull Request #98389 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-98388: Add tests for happy eyeballs and its internal workings #98389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Made test_simultaneous_success_fail fail more consistently (I hope).
  • Loading branch information
twisteroidambassador committed Oct 18, 2022
commit afb6abfae9e1510ec65cc5ee493f7d0893675bfa
11 changes: 7 additions & 4 deletions Lib/test/test_asyncio/test_staggered.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@ async def test_second_fail(self):
async def test_simultaneous_success_fail(self):
# There's a potential race condition here:
# https://github.com/python/cpython/issues/86296
for _ in range(50):
# As with any race condition, it can be difficult to reproduce.
# This test may not fail every time.
for i in range(201):
time_unit = 0.0001 * i
winner_result, winner_idx, exceptions = await staggered_race(
(
self.get_waiting_coroutine_factory(0, 0.1, True),
self.get_waiting_coroutine_factory(1, 0.05, False),
self.get_waiting_coroutine_factory(0, time_unit*2, True),
self.get_waiting_coroutine_factory(1, time_unit, False),
self.get_waiting_coroutine_factory(2, 0.05, True)
),
0.05,
time_unit,
)
self.assertEqual(winner_result, 0)
self.assertEqual(winner_idx, 0)
Expand Down
0