[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-02-02 Thread STINNER Victor
STINNER Victor added the comment: Buildbots are happy, I close the issue. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20452 ___

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
New submission from STINNER Victor: The failure is minor, it's just a suboptimal code. Calling _run_once() 4 times instead of 3. http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/9630/steps/test/logs/stdio

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5545634d98a1 by Victor Stinner in branch 'default': Issue #20452: add more info in case of test_asyncio failure to try to debug the http://hg.python.org/cpython/rev/5545634d98a1 -- nosy: +python-dev ___

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: _run_once() can be called more than expected if selector.select() was interrupted by a signal or because the granularity is wrong. If we want to avoid that, a simple fix is just to loop again in this case. Attached patch implements that (I wrote it for Tulip,

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 83e110399f3c by Victor Stinner in branch 'default': Issue #20452: Oops, fix debug code :-/ http://hg.python.org/cpython/rev/83e110399f3c -- ___ Python tracker rep...@bugs.python.org

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: It looks like select() and poll() in Linux 2.6.28 has a resolution of 1/HZ, where HZ can be retrieved from os.sysconf('SC_CLK_TCK'). Since Linux 2.6.28, hrtimers are now used for timeouts. High- (but not too high-) resolution timeouts

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: Platform of x86 Ubuntu Shared 3.x buildbot: Linux-2.6.31.5-linode21-i686-with-debian-lenny-sid little-endian, so a Linux kernel 2.6.31. It looks common on this buildbot that selector.select(timeout) takes less timeout seconds (without returning any event).

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread Charles-François Natali
Charles-François Natali added the comment: It looks like select() and poll() in Linux 2.6.28 has a resolution of 1/HZ, where HZ can be retrieved from os.sysconf('SC_CLK_TCK'). Since Linux 2.6.28, hrtimers are now used for timeouts. Attached patch improves the resolution field of

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: Just round the timeout away from 0 and be happy: this will fix the busy-wait problem, and that's all we want. I didn't work, see: http://bugs.python.org/issue20311#msg208601 Once again, I know I keep repeating myself, but having select/epoll/whatever

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: More debug info on a new failure: test_timeout_rounding failed because once EPollSelector.select(timeout=0.0099) took dt=0.0086 seconds. dt-timeout=-0.0014 and dt+granularity timeout is False (granularity=0.001, 1 millisecond). * Buildbot: x86 Gentoo

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 827d948ac6aa by Victor Stinner in branch 'default': Issue #20452: select and selectors round (again) timeout away from zero for http://hg.python.org/cpython/rev/827d948ac6aa -- ___ Python tracker

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: New changeset 827d948ac6aa by Victor Stinner in branch 'default': Issue #20452: select and selectors round (again) timeout away from zero Let's test Charles-Francois option. test_timeout_rounding failed because once EPollSelector.select(timeout=0.0099)

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: Results on x86 Gentoo 3.x buildbot: [136/389] test_asyncio WARNING: selector.select(timeout=0.09997069113887846470) took dt=0.09961039200425148010 sec (dt-timeout=-0.00036029913462698460) WARNING: dt+0.0012 timeout? True WARNING:

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 21aa1a224049 by Victor Stinner in branch 'default': Issue #20452: Remove debug code, no more needed http://hg.python.org/cpython/rev/21aa1a224049 New changeset f9a09b40bc17 by Victor Stinner in branch 'default': Issue #20311, #20452: poll and epoll

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: Summary of this issue: - test_asyncio was still failing because BaseEventLoop._granularity was not enough to round correctly timeouts, deadlines and times. poll/epoll rounded towards zero, whereas asyncio rounds away from zero. So the maximum difference in

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: Oh, another question: should I reopen the issue #20320 (round timeout in select and kqueue)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20452 ___

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: Oops, I mentionned the wrong issue number in the following commits. There were related to this issue (#20452): New changeset 8fc69d43bc49 by Victor Stinner in branch 'default': Issue #20455: math.ceil() returns an int in Python 3, no need to cast the

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7f649ff0756c by Victor Stinner in branch 'default': Issue #20452: test_asyncio: Add more info if the test fails http://hg.python.org/cpython/rev/7f649ff0756c -- ___ Python tracker rep...@bugs.python.org

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: There is a similar (but different?) issue on Windows XP. I tried to fix it with the 4 last commits. The test uses a busy loop. The scheduled handle is called after 0.100 - granularity. The granularity is usually 15.6 ms on Windows, so the expected mimiumum

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread STINNER Victor
STINNER Victor added the comment: Debug info on the Windows failure: * The busy loop took 89.99 ms * time.motononic() (which is GetTickCount64()) has a resolution of 10.0144 ms http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/7948/steps/test/logs/stdio

[issue20452] test_timeout_rounding() of test_asyncio fails on x86 Ubuntu Shared 3.x buildbot

2014-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset a090804862f8 by Victor Stinner in branch 'default': Issue #20452: test_asyncio checks also the granularity http://hg.python.org/cpython/rev/a090804862f8 New changeset 60a960434e5c by Victor Stinner in branch 'default': Issue #20452: Fix