[Python-checkins] cpython: test_selectors: test_timeout fails sometimes on busy (slow) buildbots, relax

victor.stinner python-checkins at python.org
Sun Nov 17 23:47:03 CET 2013


http://hg.python.org/cpython/rev/f2fdc675deab
changeset:   87227:f2fdc675deab
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sun Nov 17 23:46:34 2013 +0100
summary:
  test_selectors: test_timeout fails sometimes on busy (slow) buildbots, relax
the unit test on max time (but be more strict on mon time). Example of failure:

http://buildbot.python.org/all/builders/x86%20OpenIndiana%203.x/builds/6978/steps/test/logs/stdio

======================================================================
FAIL: test_timeout (test.test_selectors.PollSelectorTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/test_selectors.py", line 316, in test_timeout
    self.assertTrue(0.5 < t1 - t0 < 1.5, t1 - t0)
AssertionError: False is not true : 1.5033390671014786

files:
  Lib/test/test_selectors.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py
--- a/Lib/test/test_selectors.py
+++ b/Lib/test/test_selectors.py
@@ -313,7 +313,8 @@
         t0 = time()
         self.assertFalse(s.select(1))
         t1 = time()
-        self.assertTrue(0.5 < t1 - t0 < 1.5, t1 - t0)
+        dt = t1 - t0
+        self.assertTrue(0.8 <= dt <= 1.6, dt)
 
     @unittest.skipUnless(hasattr(signal, "alarm"),
                          "signal.alarm() required for this test")

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list