Skip to content

Commit 80db40c

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 ad8ac54 commit 80db40c

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
@@ -2516,6 +2516,7 @@ def test_wrapped_exception(self):
25162516
with self.Pool(1) as p:
25172517
with self.assertRaises(RuntimeError):
25182518
p.apply(self._test_wrapped_exception)
2519+
p.join()
25192520

25202521
def test_map_no_failfast(self):
25212522
# Issue #23992: the fail-fast behaviour when an exception is raised
@@ -2551,6 +2552,7 @@ def test_release_task_refs(self):
25512552
# they were released too.
25522553
self.assertEqual(CountedObject.n_instances, 0)
25532554

2555+
@support.reap_threads
25542556
def test_del_pool(self):
25552557
p = self.Pool(1)
25562558
wr = weakref.ref(p)

0 commit comments

Comments
 (0)