Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
12ae290b
Commit
12ae290b
authored
Nov 17, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use laxer timeouts in barrier tests
parent
82e73cb9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Lib/test/lock_tests.py
Lib/test/lock_tests.py
+5
-5
No files found.
Lib/test/lock_tests.py
View file @
12ae290b
...
...
@@ -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.
0
5
)
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment