summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-28 00:14:31 (GMT)
committerGitHub <noreply@github.com>2018-11-28 00:14:31 (GMT)
commitb7278736b3ae158a7738057e3045bc767ced019e (patch)
tree4f0607bd3b7a88d0217dd63ec0f2775af8271e84 /Lib/test/_test_multiprocessing.py
parent9bdd2de84c1af55fbc006d3f892313623bd0195c (diff)
downloadcpython-b7278736b3ae158a7738057e3045bc767ced019e.zip
cpython-b7278736b3ae158a7738057e3045bc767ced019e.tar.gz
cpython-b7278736b3ae158a7738057e3045bc767ced019e.tar.bz2
bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)
Fix WithThreadsTestPool.test_wrapped_exception() of test_multiprocessing_fork: join the pool. WithThreadsTestPool.test_del_pool() is now also decorated with @support.reap_threads.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 4302708..b62c119 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2522,6 +2522,7 @@ class _TestPool(BaseTestCase):
with self.Pool(1) as p:
with self.assertRaises(RuntimeError):
p.apply(self._test_wrapped_exception)
+ p.join()
def test_map_no_failfast(self):
# Issue #23992: the fail-fast behaviour when an exception is raised
@@ -2557,6 +2558,7 @@ class _TestPool(BaseTestCase):
# they were released too.
self.assertEqual(CountedObject.n_instances, 0)
+ @support.reap_threads
def test_del_pool(self):
p = self.Pool(1)
wr = weakref.ref(p)