bpo-37421: multiprocessing tests now stop ForkServer (GH-14601) · python/cpython@229f6e8 · GitHub
Skip to content

Commit 229f6e8

Browse files
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. (cherry picked from commit 8fbeb14) Co-authored-by: Victor Stinner <vstinner@redhat.com>
1 parent b4cd6ba commit 229f6e8

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lib/multiprocessing/forkserver.py

Lines changed: 19 additions & 0 deletions

Lib/test/_test_multiprocessing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5650,7 +5650,13 @@ def tearDownModule():
56505650
# Sleep 500 ms to give time to child processes to complete.
56515651
if need_sleep:
56525652
time.sleep(0.5)
5653+
56535654
multiprocessing.process._cleanup()
5655+
5656+
# Stop the ForkServer process if it's running
5657+
from multiprocessing import forkserver
5658+
forkserver._forkserver._stop()
5659+
56545660
# bpo-37421: Explicitly call _run_finalizers() to remove immediately
56555661
# temporary directories created by multiprocessing.util.get_temp_dir().
56565662
multiprocessing.util._run_finalizers()
Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)