[issue14428] Implementation of the PEP 418

Charles-François Natali report at bugs.python.org
Sun Apr 29 11:02:51 CEST 2012


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

test_process_time_threads is failing on one of the buildbots:
"""
======================================================================
FAIL: test_process_time_threads (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/buildbot/buildarea/3.x.warsaw-ubuntu-arm/build/Lib/test/test_time.py", line 408, in test_process_time_threads
    self.assertGreater(t2 - t1, 0.1)
AssertionError: 0.08041412500006118 not greater than 0.1
"""

The test is a bit too optimistic: a thread is looping for 0.2s, and the test checks that the process time (user + system) increased of at least 0.1s. If the thread is preempted, there's a high chance you won't get even as low as 0.1s.
I see two options: either increase the total running time, to make it really likely you'll get a chance to run (or decrase the lower threshold), or use times(2), and check the result against that (does Windows have such a syscall?).

----------
status: closed -> open

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


More information about the Python-bugs-list mailing list