Skip to content

Commit b727873

Browse files
authored
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.
1 parent 9bdd2de commit b727873

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
@@ -2522,6 +2522,7 @@ def test_wrapped_exception(self):
25222522
with self.Pool(1) as p:
25232523
with self.assertRaises(RuntimeError):
25242524
p.apply(self._test_wrapped_exception)
2525+
p.join()
25252526

25262527
def test_map_no_failfast(self):
25272528
# Issue #23992: the fail-fast behaviour when an exception is raised
@@ -2557,6 +2558,7 @@ def test_release_task_refs(self):
25572558
# they were released too.
25582559
self.assertEqual(CountedObject.n_instances, 0)
25592560

2561+
@support.reap_threads
25602562
def test_del_pool(self):
25612563
p = self.Pool(1)
25622564
wr = weakref.ref(p)

0 commit comments

Comments
 (0)