From 039fb49c185570ab7b02f13fbdc51c859cfd831e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 2 Jul 2019 13:32:32 +0200 Subject: [PATCH] bpo-37421: multiprocessing tests call _run_finalizers() (GH-14527) multiprocessing tests now call explicitly _run_finalizers() to remove immediately temporary directories created by multiprocessing.util.get_temp_dir(). --- Lib/test/_test_multiprocessing.py | 3 +++ .../NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index eef262d723d..af5b91d17e7 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5651,6 +5651,9 @@ def tearDownModule(): if need_sleep: time.sleep(0.5) multiprocessing.process._cleanup() + # bpo-37421: Explicitly call _run_finalizers() to remove immediately + # temporary directories created by multiprocessing.util.get_temp_dir(). + multiprocessing.util._run_finalizers() test.support.gc_collect() remote_globs['setUpModule'] = setUpModule diff --git a/Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst b/Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst new file mode 100644 index 00000000000..c379b504ba8 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst @@ -0,0 +1,2 @@ +multiprocessing tests now explicitly call ``_run_finalizers()`` to +immediately remove temporary directories created by tests.