Skip to content

gh-109833: Fix asyncio test_wait_for() #109834

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

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Lib/test/test_asyncio/test_waitfor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
import unittest
import time
from test import support


def tearDownModule():
Expand Down Expand Up @@ -130,7 +131,7 @@ async def foo():
nonlocal foo_running
foo_running = True
try:
await asyncio.sleep(10)
await asyncio.sleep(support.LONG_TIMEOUT)
finally:
foo_running = False
return 'done'
Expand All @@ -144,7 +145,7 @@ async def foo():
self.assertTrue(fut.done())
# it should have been cancelled due to the timeout
self.assertTrue(fut.cancelled())
self.assertLess(t1 - t0, 0.5)
self.assertLess(t1 - t0, support.SHORT_TIMEOUT)
self.assertEqual(foo_running, False)

async def test_wait_for_blocking(self):
Expand Down