Charles-François Natali <neolo...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue13878>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to