summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-07-05 14:15:39 (GMT)
committerGitHub <noreply@github.com>2019-07-05 14:15:39 (GMT)
commit8fbeb14312b4c1320d31ad86e69749515879d1c3 (patch)
treececcd8ce515360bb685f05e1af635e1d67dea350 /Lib/test/_test_multiprocessing.py
parent0d722f3cd602e5f5492f9c65c8af57ea9d3743b6 (diff)
downloadcpython-8fbeb14312b4c1320d31ad86e69749515879d1c3.zip
cpython-8fbeb14312b4c1320d31ad86e69749515879d1c3.tar.gz
cpython-8fbeb14312b4c1320d31ad86e69749515879d1c3.tar.bz2
bpo-37421: multiprocessing tests now stop ForkServer (GH-14601)
multiprocessing tests now stop the ForkServer instance if it's running: close the "alive" file descriptor to ask the server to stop and then remove its UNIX address.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index af5b91d..9a39f38 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -5650,7 +5650,13 @@ def install_tests_in_module_dict(remote_globs, start_method):
# Sleep 500 ms to give time to child processes to complete.
if need_sleep:
time.sleep(0.5)
+
multiprocessing.process._cleanup()
+
+ # Stop the ForkServer process if it's running
+ from multiprocessing import forkserver
+ forkserver._forkserver._stop()
+
# bpo-37421: Explicitly call _run_finalizers() to remove immediately
# temporary directories created by multiprocessing.util.get_temp_dir().
multiprocessing.util._run_finalizers()