Skip to content

Commit e44b5b2

Browse files
bpo-35424: test_multiprocessing: join 3 pools (GH-10986)
Join 3 pools in these tests: * test.test_multiprocessing_spawn.WithProcessesTestPool.test_context * test.test_multiprocessing_spawn.WithProcessesTestPool.test_traceback (cherry picked from commit 388c8c2) Co-authored-by: Victor Stinner <vstinner@redhat.com>
1 parent f9d8b68 commit e44b5b2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/_test_multiprocessing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,7 @@ def test_context(self):
21992199
with self.Pool(2) as p:
22002200
r = p.map_async(sqr, L)
22012201
self.assertEqual(r.get(), expected)
2202+
p.join()
22022203
self.assertRaises(ValueError, p.map_async, sqr, L)
22032204

22042205
@classmethod
@@ -2216,6 +2217,7 @@ def test_traceback(self):
22162217
exc = e
22172218
else:
22182219
self.fail('expected RuntimeError')
2220+
p.join()
22192221
self.assertIs(type(exc), RuntimeError)
22202222
self.assertEqual(exc.args, (123,))
22212223
cause = exc.__cause__
@@ -2240,6 +2242,7 @@ def test_traceback(self):
22402242
self.fail('expected SayWhenError')
22412243
self.assertIs(type(exc), SayWhenError)
22422244
self.assertIs(exc.__cause__, None)
2245+
p.join()
22432246

22442247
@classmethod
22452248
def _test_wrapped_exception(cls):

0 commit comments

Comments
 (0)