File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1014,13 +1014,15 @@ def test_default_timeout(self):
1014
1014
"""
1015
1015
Test the barrier's default timeout
1016
1016
"""
1017
- # create a barrier with a low default timeout
1018
- barrier = self .barriertype (self .N , timeout = 0.3 )
1017
+ # gh-109401: Barrier timeout should be long enough
1018
+ # to create 4 threads on a slow CI.
1019
+ timeout = 1.0
1020
+ barrier = self .barriertype (self .N , timeout = timeout )
1019
1021
def f ():
1020
1022
i = barrier .wait ()
1021
1023
if i == self .N // 2 :
1022
- # One thread is later than the default timeout of 0.3s .
1023
- time .sleep (1.0 )
1024
+ # One thread is later than the default timeout.
1025
+ time .sleep (timeout * 2 )
1024
1026
self .assertRaises (threading .BrokenBarrierError , barrier .wait )
1025
1027
self .run_threads (f )
1026
1028
You can’t perform that action at this time.
0 commit comments