]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35424: test_multiprocessing: join 3 pools (GH-10986)
authorVictor Stinner <vstinner@redhat.com>
Thu, 6 Dec 2018 10:56:52 +0000 (11:56 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 10:56:52 +0000 (11:56 +0100)
Join 3 pools in these tests:

* test.test_multiprocessing_spawn.WithProcessesTestPool.test_context
* test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback

Lib/test/_test_multiprocessing.py

index 163419c30ebabace92a7ccf6f5e104c4b79ce0f2..0b0fe7c9b298009bfcf6020d81808b26549ae12d 100644 (file)
@@ -2471,6 +2471,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
@@ -2488,6 +2489,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__
@@ -2512,6 +2514,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):