[issue13878] test_sched failures on Windows buildbot

Charles-François Natali report at bugs.python.org
Sat Feb 4 16:10:11 CET 2012


Charles-François Natali <neologix at free.fr> added the comment:

"""
for x in [0.05, 0.04, 0.03, 0.02, 0.01]:
    z = scheduler.enter(x, 1, fun, (x,))
"""

Since the test uses relative times, if the process is preempted more than 0.01s between two calls to enter (or if the clock goes backwards), the absolute times won't be monotonic:

time.time() -> t
scheduler.enter(0.05, 1, fun, (0.05,)) -> scheduler.enterabs(t+0.05, 1, fun, (0,))
<preempted for 0.02s/clock goes backwards>
time.time() -> t+0.02
scheduler.enter(0.04, 1, fun, (0.04,)) -> scheduler.enterabs(t+0.02+0.04=t+0.06, 1, fun, (0,))
and 0.04 would end up after 0.05 in the queue.

Changing the sequence for [0.5, 0.4, 0.3, 0.2, 0.1] should make the test more robust (other tests seem to have the same problem).

----------
nosy: +neologix

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13878>
_______________________________________


More information about the Python-bugs-list mailing list