bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (GH-13816)

test_venv.test_mutiprocessing() now explicitly calls pool.terminate()
to wait until the pool completes.
This commit is contained in:
Victor Stinner 2019-06-04 19:03:13 +02:00 committed by GitHub
parent 8d0ef0b5ed
commit bc6469f79c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -325,8 +325,10 @@ def test_multiprocessing(self):
envpy = os.path.join(os.path.realpath(self.env_dir),
self.bindir, self.exe)
out, err = check_output([envpy, '-c',
'from multiprocessing import Pool; ' +
'print(Pool(1).apply_async("Python".lower).get(3))'])
'from multiprocessing import Pool; '
'pool = Pool(1); '
'print(pool.apply_async("Python".lower).get(3)); '
'pool.terminate()'])
self.assertEqual(out.strip(), "python".encode())
@requireVenvCreate

View File

@ -0,0 +1,2 @@
``test_venv.test_mutiprocessing()`` now explicitly calls
``pool.terminate()`` to wait until the pool completes.