From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 28 Nov 2018 00:30:34 +0000 (-0800) Subject: bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755) X-Git-Tag: v3.7.2rc1~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80db40cdd6a58c9d66694a43ee9a7c06ab958373;p=thirdparty%2FPython%2Fcpython.git 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. (cherry picked from commit b7278736b3ae158a7738057e3045bc767ced019e) Co-authored-by: Victor Stinner --- diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 6e416a9855da..7a657d9d120c 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2516,6 +2516,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 @@ -2551,6 +2552,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)