New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_sched failures on Windows buildbot #58086
Comments
http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%203.x/builds/4072/steps/test/logs/stdio:
Traceback (most recent call last):
File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_sched.py", line 18, in test_enter
self.assertEqual(l, [0.01, 0.02, 0.03, 0.04, 0.05])
AssertionError: Lists differ: [0.01, 0.02, 0.03, 0.05, 0.04] != [0.01, 0.02, 0.03, 0.04, 0.05]
http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%203.x/builds/4062/steps/test/logs/stdio:
Traceback (most recent call last):
File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_sched.py", line 74, in test_queue
self.assertEqual(list(scheduler.queue), [e1, e2, e3, e4, e5])
AssertionError: Lists differ: [Event(time=1327366698.525, pr... != [Event(time=1327366698.525, pr...
|
""" 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 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). |
Here's another failure due to the same type of race: """ Traceback (most recent call last):
File "D:\Buildslave\3.x.moore-windows\build\lib\test\test_sched.py", line 74, in test_queue
self.assertEqual(list(scheduler.queue), [e1, e2, e3, e4, e5])
AssertionError: Lists differ: [Event(time=1328544857.025, pr... != [Event(time=1328544857.025, pr... First differing element 2: Diff is 836 characters long. Set self.maxDiff to None to see it. Here's a patch that:
It should fix all those failures. |
Patch looks good, but you might want to make this change to test_priority: l = []
fun = lambda x: l.append(x)
scheduler = sched.scheduler(time.time, time.sleep)
+ now = time.time()
for priority in [1, 2, 3, 4, 5]:
- z = scheduler.enterabs(0.01, priority, fun, (priority,))
+ z = scheduler.enterabs(now + 0.01, priority, fun, (priority,))
scheduler.run()
self.assertEqual(l, [1, 2, 3, 4, 5]) |
Well, it's not really needed, as long as scheduler deals correctly |
Ah, I suppose that makes sense. |
New changeset 662c60d26183 by Charles-François Natali in branch '3.2': New changeset e35091b95813 by Charles-François Natali in branch 'default': |
Should be fixed now, thanks. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: