]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35424: test_multiprocessing: join 3 pools (GH-10986)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 6 Dec 2018 11:20:50 +0000 (03:20 -0800)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 11:20:50 +0000 (03:20 -0800)
Join 3 pools in these tests:

* test.test_multiprocessing_spawn.WithProcessesTestPool.test_context
* test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback
(cherry picked from commit 388c8c208d9d09bd28289c1e4776b947d4d0f0f0)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Lib/test/_test_multiprocessing.py

index a0daa43a55a16c0d185e37fce200a09f47e28913..abcb5d45e7ab7af4072feba2d4cbadde97b6ee5b 100644 (file)
@@ -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):