Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9791ba commit e5186c3Copy full SHA for e5186c3
1 file changed
Lib/test/lock_tests.py
@@ -1014,13 +1014,15 @@ def test_default_timeout(self):
1014
"""
1015
Test the barrier's default timeout
1016
1017
- # create a barrier with a low default timeout
1018
- barrier = self.barriertype(self.N, timeout=0.3)
+ # gh-109401: Barrier timeout should be long enough
+ # to create 4 threads on a slow CI.
1019
+ timeout = 1.0
1020
+ barrier = self.barriertype(self.N, timeout=timeout)
1021
def f():
1022
i = barrier.wait()
1023
if i == self.N // 2:
- # One thread is later than the default timeout of 0.3s.
- time.sleep(1.0)
1024
+ # One thread is later than the default timeout.
1025
+ time.sleep(timeout * 2)
1026
self.assertRaises(threading.BrokenBarrierError, barrier.wait)
1027
self.run_threads(f)
1028
0 commit comments