Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6093a12

Browse files
committed
Issue #20505: Use even shorter sleep in test_timeout_rounding() to make the
test more reliable (= fail more often on Windows with HPET enabled).
1 parent a176d2d commit 6093a12

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Lib/test/test_asyncio/test_events.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,13 +1176,15 @@ def wait():
11761176
loop = self.loop
11771177
yield from asyncio.sleep(1e-2, loop=loop)
11781178
yield from asyncio.sleep(1e-4, loop=loop)
1179+
yield from asyncio.sleep(1e-6, loop=loop)
1180+
yield from asyncio.sleep(1e-8, loop=loop)
11791181

11801182
self.loop.run_until_complete(wait())
1181-
# The ideal number of call is 6, but on some platforms, the selector
1183+
# The ideal number of call is 10, but on some platforms, the selector
11821184
# may sleep at little bit less than timeout depending on the resolution
1183-
# of the clock used by the kernel. Tolerate 2 useless calls on these
1185+
# of the clock used by the kernel. Tolerate 5 useless calls on these
11841186
# platforms.
1185-
self.assertLessEqual(self.loop._run_once_counter, 8,
1187+
self.assertLessEqual(self.loop._run_once_counter, 15,
11861188
{'time_info': time.get_clock_info('time'),
11871189
'monotonic_info': time.get_clock_info('monotonic'),
11881190
'selector': self.loop._selector.__class__.__name__})

0 commit comments

Comments
 (0)