]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 28 Nov 2018 00:37:23 +0000 (16:37 -0800)
committerGitHub <noreply@github.com>
Wed, 28 Nov 2018 00:37:23 +0000 (16:37 -0800)
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 <vstinner@redhat.com>
Lib/test/_test_multiprocessing.py

index 6667f117857482d2ce806922324b1ee0378d03ae..59f9a2e1e2eb6234573ce42ed713e9472c65fcf2 100644 (file)
@@ -2250,6 +2250,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
@@ -2285,6 +2286,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)