mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #20505: BaseEventLoop uses again the resolution of the clock to decide if
scheduled tasks should be executed or not.
This commit is contained in:
parent
b825a3937c
commit
6cf5c96630
2 changed files with 9 additions and 8 deletions
|
@ -1178,15 +1178,15 @@ class EventLoopTestsMixin:
|
|||
yield from asyncio.sleep(1e-4, loop=loop)
|
||||
yield from asyncio.sleep(1e-6, loop=loop)
|
||||
yield from asyncio.sleep(1e-8, loop=loop)
|
||||
yield from asyncio.sleep(1e-10, loop=loop)
|
||||
|
||||
self.loop.run_until_complete(wait())
|
||||
# The ideal number of call is 10, but on some platforms, the selector
|
||||
# The ideal number of call is 12, but on some platforms, the selector
|
||||
# may sleep at little bit less than timeout depending on the resolution
|
||||
# of the clock used by the kernel. Tolerate 5 useless calls on these
|
||||
# platforms.
|
||||
self.assertLessEqual(self.loop._run_once_counter, 15,
|
||||
{'time_info': time.get_clock_info('time'),
|
||||
'monotonic_info': time.get_clock_info('monotonic'),
|
||||
# of the clock used by the kernel. Tolerate a few useless calls on
|
||||
# these platforms.
|
||||
self.assertLessEqual(self.loop._run_once_counter, 20,
|
||||
{'clock_resolution': self.loop._clock_resolution,
|
||||
'selector': self.loop._selector.__class__.__name__})
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue