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
13758848
Commit
13758848
authored
Jun 18, 2012
by
Richard Oudkerk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fiddle with timeouts in barrier tests
parent
10e65881
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Lib/test/test_multiprocessing.py
Lib/test/test_multiprocessing.py
+6
-6
No files found.
Lib/test/test_multiprocessing.py
View file @
13758848
...
...
@@ -1151,7 +1151,7 @@ class _TestBarrier(BaseTestCase):
Tests for Barrier objects.
"""
N
=
5
defaultTimeout
=
1
0.0
# XXX Slow Windows buildbots need generous timeout
defaultTimeout
=
3
0.0
# XXX Slow Windows buildbots need generous timeout
def
setUp
(
self
):
self
.
barrier
=
self
.
Barrier
(
self
.
N
,
timeout
=
self
.
defaultTimeout
)
...
...
@@ -1327,10 +1327,10 @@ class _TestBarrier(BaseTestCase):
@
classmethod
def
_test_timeout_f
(
cls
,
barrier
,
results
):
i
=
barrier
.
wait
(
20
)
i
=
barrier
.
wait
()
if
i
==
cls
.
N
//
2
:
# One thread is late!
time
.
sleep
(
4
.0
)
time
.
sleep
(
1
.0
)
try
:
barrier
.
wait
(
0.5
)
except
threading
.
BrokenBarrierError
:
...
...
@@ -1346,10 +1346,10 @@ class _TestBarrier(BaseTestCase):
@
classmethod
def
_test_default_timeout_f
(
cls
,
barrier
,
results
):
i
=
barrier
.
wait
(
20
)
i
=
barrier
.
wait
(
cls
.
defaultTimeout
)
if
i
==
cls
.
N
//
2
:
# One thread is later than the default timeout
time
.
sleep
(
4
.0
)
time
.
sleep
(
1
.0
)
try
:
barrier
.
wait
()
except
threading
.
BrokenBarrierError
:
...
...
@@ -1359,7 +1359,7 @@ class _TestBarrier(BaseTestCase):
"""
Test the barrier's default timeout
"""
barrier
=
self
.
Barrier
(
self
.
N
,
timeout
=
1.0
)
barrier
=
self
.
Barrier
(
self
.
N
,
timeout
=
0.5
)
results
=
self
.
DummyList
()
self
.
run_threads
(
self
.
_test_default_timeout_f
,
(
barrier
,
results
))
self
.
assertEqual
(
len
(
results
),
barrier
.
parties
)
...
...
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