summaryrefslogtreecommitdiffstats
path: root/Lib/test/lock_tests.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-11-17 21:55:41 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-11-17 21:55:41 (GMT)
commit12ae290bf32adbc8f4885ec342f5a17a4955fe15 (patch)
tree04c51e20d268c5b7a48c4605c0a2e1049c1e5a5d /Lib/test/lock_tests.py
parent82e73cb951b72d91b924452ee44eefb6f135640f (diff)
downloadcpython-12ae290bf32adbc8f4885ec342f5a17a4955fe15.zip
cpython-12ae290bf32adbc8f4885ec342f5a17a4955fe15.tar.gz
cpython-12ae290bf32adbc8f4885ec342f5a17a4955fe15.tar.bz2
Use laxer timeouts in barrier tests
Diffstat (limited to 'Lib/test/lock_tests.py')
-rw-r--r--Lib/test/lock_tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py
index c543e68..d956bb6 100644
--- a/Lib/test/lock_tests.py
+++ b/Lib/test/lock_tests.py
@@ -604,7 +604,7 @@ class BarrierTests(BaseTestCase):
Tests for Barrier objects.
"""
N = 5
- defaultTimeout = 0.5
+ defaultTimeout = 2.0
def setUp(self):
self.barrier = self.barriertype(self.N, timeout=self.defaultTimeout)
@@ -766,10 +766,10 @@ class BarrierTests(BaseTestCase):
i = self.barrier.wait()
if i == self.N // 2:
# One thread is late!
- time.sleep(0.1)
- # Default timeout is 0.1, so this is shorter.
+ time.sleep(1.0)
+ # Default timeout is 2.0, so this is shorter.
self.assertRaises(threading.BrokenBarrierError,
- self.barrier.wait, 0.05)
+ self.barrier.wait, 0.5)
self.run_threads(f)
def test_default_timeout(self):
@@ -782,7 +782,7 @@ class BarrierTests(BaseTestCase):
i = barrier.wait()
if i == self.N // 2:
# One thread is later than the default timeout of 0.1s.
- time.sleep(0.2)
+ time.sleep(1.0)
self.assertRaises(threading.BrokenBarrierError, barrier.wait)
self.run_threads(f)