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
7b2a37b7
Commit
7b2a37b7
authored
Feb 09, 2019
by
Pablo Galindo
Committed by
GitHub
Feb 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the BaseManager in test_multiprocessing is cleaned up correctly (GH-11653)
parent
613f729e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
Lib/test/_test_multiprocessing.py
Lib/test/_test_multiprocessing.py
+20
-15
No files found.
Lib/test/_test_multiprocessing.py
View file @
7b2a37b7
...
@@ -2817,6 +2817,7 @@ class _TestRemoteManager(BaseTestCase):
...
@@ -2817,6 +2817,7 @@ class _TestRemoteManager(BaseTestCase):
address
=
(
test
.
support
.
HOST
,
0
),
authkey
=
authkey
,
serializer
=
SERIALIZER
address
=
(
test
.
support
.
HOST
,
0
),
authkey
=
authkey
,
serializer
=
SERIALIZER
)
)
manager
.
start
()
manager
.
start
()
self
.
addCleanup
(
manager
.
shutdown
)
p
=
self
.
Process
(
target
=
self
.
_putter
,
args
=
(
manager
.
address
,
authkey
))
p
=
self
.
Process
(
target
=
self
.
_putter
,
args
=
(
manager
.
address
,
authkey
))
p
.
daemon
=
True
p
.
daemon
=
True
...
@@ -2836,7 +2837,6 @@ class _TestRemoteManager(BaseTestCase):
...
@@ -2836,7 +2837,6 @@ class _TestRemoteManager(BaseTestCase):
# Make queue finalizer run before the server is stopped
# Make queue finalizer run before the server is stopped
del
queue
del
queue
manager
.
shutdown
()
class
_TestManagerRestart
(
BaseTestCase
):
class
_TestManagerRestart
(
BaseTestCase
):
...
@@ -2852,25 +2852,29 @@ class _TestManagerRestart(BaseTestCase):
...
@@ -2852,25 +2852,29 @@ class _TestManagerRestart(BaseTestCase):
authkey
=
os
.
urandom
(
32
)
authkey
=
os
.
urandom
(
32
)
manager
=
QueueManager
(
manager
=
QueueManager
(
address
=
(
test
.
support
.
HOST
,
0
),
authkey
=
authkey
,
serializer
=
SERIALIZER
)
address
=
(
test
.
support
.
HOST
,
0
),
authkey
=
authkey
,
serializer
=
SERIALIZER
)
srvr
=
manager
.
get_server
()
try
:
addr
=
srvr
.
address
srvr
=
manager
.
get_server
()
# Close the connection.Listener socket which gets opened as a part
addr
=
srvr
.
address
# of manager.get_server(). It's not needed for the test.
# Close the connection.Listener socket which gets opened as a part
srvr
.
listener
.
close
()
# of manager.get_server(). It's not needed for the test.
manager
.
start
()
srvr
.
listener
.
close
()
manager
.
start
()
p
=
self
.
Process
(
target
=
self
.
_putter
,
args
=
(
manager
.
address
,
authkey
))
p
=
self
.
Process
(
target
=
self
.
_putter
,
args
=
(
manager
.
address
,
authkey
))
p
.
start
()
p
.
start
()
p
.
join
()
p
.
join
()
queue
=
manager
.
get_queue
()
queue
=
manager
.
get_queue
()
self
.
assertEqual
(
queue
.
get
(),
'hello world'
)
self
.
assertEqual
(
queue
.
get
(),
'hello world'
)
del
queue
del
queue
manager
.
shutdown
()
finally
:
if
hasattr
(
manager
,
"shutdown"
):
manager
.
shutdown
()
manager
=
QueueManager
(
manager
=
QueueManager
(
address
=
addr
,
authkey
=
authkey
,
serializer
=
SERIALIZER
)
address
=
addr
,
authkey
=
authkey
,
serializer
=
SERIALIZER
)
try
:
try
:
manager
.
start
()
manager
.
start
()
self
.
addCleanup
(
manager
.
shutdown
)
except
OSError
as
e
:
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
EADDRINUSE
:
if
e
.
errno
!=
errno
.
EADDRINUSE
:
raise
raise
...
@@ -2879,7 +2883,8 @@ class _TestManagerRestart(BaseTestCase):
...
@@ -2879,7 +2883,8 @@ class _TestManagerRestart(BaseTestCase):
time
.
sleep
(
1.0
)
time
.
sleep
(
1.0
)
manager
=
QueueManager
(
manager
=
QueueManager
(
address
=
addr
,
authkey
=
authkey
,
serializer
=
SERIALIZER
)
address
=
addr
,
authkey
=
authkey
,
serializer
=
SERIALIZER
)
manager
.
shutdown
()
if
hasattr
(
manager
,
"shutdown"
):
self
.
addCleanup
(
manager
.
shutdown
)
#
#
#
#
...
...
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