Skip to content

Commit dd52938

Browse files
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 b727873) Co-authored-by: Victor Stinner <[email protected]>
1 parent d5c8bd8 commit dd52938

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,6 +2250,7 @@ def test_wrapped_exception(self):
22502250
with self.Pool(1) as p:
22512251
with self.assertRaises(RuntimeError):
22522252
p.apply(self._test_wrapped_exception)
2253+
p.join()
22532254

22542255
def test_map_no_failfast(self):
22552256
# Issue #23992: the fail-fast behaviour when an exception is raised
@@ -2285,6 +2286,7 @@ def test_release_task_refs(self):
22852286
# they were released too.
22862287
self.assertEqual(CountedObject.n_instances, 0)
22872288

2289+
@support.reap_threads
22882290
def test_del_pool(self):
22892291
p = self.Pool(1)
22902292
wr = weakref.ref(p)

0 commit comments

Comments
 (0)