mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
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.
This commit is contained in:
parent
9bdd2de84c
commit
b7278736b3
1 changed files with 2 additions and 0 deletions
|
@ -2522,6 +2522,7 @@ class _TestPool(BaseTestCase):
|
||||||
with self.Pool(1) as p:
|
with self.Pool(1) as p:
|
||||||
with self.assertRaises(RuntimeError):
|
with self.assertRaises(RuntimeError):
|
||||||
p.apply(self._test_wrapped_exception)
|
p.apply(self._test_wrapped_exception)
|
||||||
|
p.join()
|
||||||
|
|
||||||
def test_map_no_failfast(self):
|
def test_map_no_failfast(self):
|
||||||
# Issue #23992: the fail-fast behaviour when an exception is raised
|
# Issue #23992: the fail-fast behaviour when an exception is raised
|
||||||
|
@ -2557,6 +2558,7 @@ class _TestPool(BaseTestCase):
|
||||||
# they were released too.
|
# they were released too.
|
||||||
self.assertEqual(CountedObject.n_instances, 0)
|
self.assertEqual(CountedObject.n_instances, 0)
|
||||||
|
|
||||||
|
@support.reap_threads
|
||||||
def test_del_pool(self):
|
def test_del_pool(self):
|
||||||
p = self.Pool(1)
|
p = self.Pool(1)
|
||||||
wr = weakref.ref(p)
|
wr = weakref.ref(p)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue