diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index a0daa43a55a..abcb5d45e7a 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2465,6 +2465,7 @@ class _TestPool(BaseTestCase): with self.Pool(2) as p: r = p.map_async(sqr, L) self.assertEqual(r.get(), expected) + p.join() self.assertRaises(ValueError, p.map_async, sqr, L) @classmethod @@ -2482,6 +2483,7 @@ class _TestPool(BaseTestCase): exc = e else: self.fail('expected RuntimeError') + p.join() self.assertIs(type(exc), RuntimeError) self.assertEqual(exc.args, (123,)) cause = exc.__cause__ @@ -2506,6 +2508,7 @@ class _TestPool(BaseTestCase): self.fail('expected SayWhenError') self.assertIs(type(exc), SayWhenError) self.assertIs(exc.__cause__, None) + p.join() @classmethod def _test_wrapped_exception(cls):