[Python-checkins] bpo-33676: Fix dangling thread in _test_multiprocessing (GH-10755)

Miss Islington (bot) webhook-mailer at python.org
Tue Nov 27 19:37:28 EST 2018


https://github.com/python/cpython/commit/dd5293871703e6a12ffdde14eeaa86a73b7b0d99
commit: dd5293871703e6a12ffdde14eeaa86a73b7b0d99
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-11-27T16:37:23-08:00
summary:

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 <vstinner at redhat.com>

files:
M Lib/test/_test_multiprocessing.py

diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 6667f1178574..59f9a2e1e2eb 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2250,6 +2250,7 @@ def test_wrapped_exception(self):
         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 @@ def test_release_task_refs(self):
         # 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)



More information about the Python-checkins mailing list