homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients giampaolo.rodola, nadeem.vawda, neologix
Date 2012年02月04日.15:10:10
SpamBayes Score 1.1593912e-07
Marked as misclassified No
Message-id <1328368211.14.0.106052430413.issue13878@psf.upfronthosting.co.za>
In-reply-to
Content
"""
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).
History
Date User Action Args
2012年02月04日 15:10:11neologixsetrecipients: + neologix, giampaolo.rodola, nadeem.vawda
2012年02月04日 15:10:11neologixsetmessageid: <1328368211.14.0.106052430413.issue13878@psf.upfronthosting.co.za>
2012年02月04日 15:10:10neologixlinkissue13878 messages
2012年02月04日 15:10:10neologixcreate

AltStyle によって変換されたページ (->オリジナル) /