STINNER Victor added the comment:

Ok, I reproduced the issue on my Windows 7 after enabling HPET:

== CPython 3.4.0b3+ (default:1b96d08c3895, Feb 10 2014, 18:44:24) [MSC v.1600 32
 bit (Intel)]
==   Windows-7-6.1.7601-SP1 little-endian
[1/1] test_asyncio
test_timeout_rounding (test.test_asyncio.test_events.ProactorEventLoopTests) ...
 asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
FAIL
test_timeout_rounding (test.test_asyncio.test_events.SelectEventLoopTests) ... a
syncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
asyncio: selector.select(0.100 ms) took 0.000 ms
FAIL

======================================================================
FAIL: test_timeout_rounding (test.test_asyncio.test_events.ProactorEventLoopTest
s)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\haypo\python_default\lib\test\test_asyncio\test_events.py", line 1188
, in test_timeout_rounding
    'selector': self.loop._selector.__class__.__name__})
AssertionError: 18 not less than or equal to 8 : {'time_info': namespace(adjusta
ble=True, implementation='GetSystemTimeAsFileTime()', monotonic=False, resolutio
n=0.015600099999999999), 'selector': 'IocpProactor', 'monotonic_info': namespace
(adjustable=False, implementation='GetTickCount64()', monotonic=True, resolution
=0.015600099999999999)}

======================================================================
FAIL: test_timeout_rounding (test.test_asyncio.test_events.SelectEventLoopTests)

----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\haypo\python_default\lib\test\test_asyncio\test_events.py", line 1188
, in test_timeout_rounding
    'selector': self.loop._selector.__class__.__name__})
AssertionError: 13 not less than or equal to 8 : {'time_info': namespace(adjusta
ble=True, implementation='GetSystemTimeAsFileTime()', monotonic=False, resolutio
n=0.015600099999999999), 'selector': 'SelectSelector', 'monotonic_info': namespa
ce(adjustable=False, implementation='GetTickCount64()', monotonic=True, resoluti
on=0.015600099999999999)}

It looks like GetQueuedCompletionStatus(ms) takes between (ms - 1) and (ms) 
milliseconds. Examples:

GetQueuedCompletionStatus(1 ms)->None took 0.417 ms (monotonic: 0.000 ms)
GetQueuedCompletionStatus(1 ms)->None took 0.307 ms (monotonic: 0.000 ms)
GetQueuedCompletionStatus(2 ms)->None took 1.101 ms (monotonic: 16.000 ms)
GetQueuedCompletionStatus(10 ms)->None took 9.971 ms (monotonic: 0.000 ms)
GetQueuedCompletionStatus(10 ms)->None took 9.908 ms (monotonic: 15.000 ms)
GetQueuedCompletionStatus(2 ms)->None took 1.634 ms (monotonic: 0.000 ms)

I used time.perf_counter() to measure elapsed time, with elapsed "monotonic" 
time in parenthesis. As you can see, the monotonic clock is usually unchanged 
for such short sleep.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20505>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to