]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #11871: In test_threading.BarrierTests, bump the default barrier timeout
authorCharles-François Natali <neologix@free.fr>
Wed, 27 Jul 2011 19:26:42 +0000 (21:26 +0200)
committerCharles-François Natali <neologix@free.fr>
Wed, 27 Jul 2011 19:26:42 +0000 (21:26 +0200)
to avoid timing-dependent failures.

Lib/test/lock_tests.py

index f0a24117f474a2011176c0d1e8fc7f2b9d1620c8..30148e638a687ff2f219b084fe11cac87879adf1 100644 (file)
@@ -832,12 +832,12 @@ class BarrierTests(BaseTestCase):
         """
         Test the barrier's default timeout
         """
-        #create a barrier with a low default timeout
-        barrier = self.barriertype(self.N, timeout=0.1)
+        # create a barrier with a low default timeout
+        barrier = self.barriertype(self.N, timeout=0.3)
         def f():
             i = barrier.wait()
             if i == self.N // 2:
-                # One thread is later than the default timeout of 0.1s.
+                # One thread is later than the default timeout of 0.3s.
                 time.sleep(1.0)
             self.assertRaises(threading.BrokenBarrierError, barrier.wait)
         self.run_threads(f)