From 6d24a6e0bbd1e073ce183d15463066d6ae59dbd4 Mon Sep 17 00:00:00 2001 From: Richard Oudkerk Date: Thu, 21 Nov 2013 16:35:12 +0000 Subject: [PATCH] Issue #19599: Use a separate pool for test_terminate(). --- Lib/test/test_multiprocessing.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 3a43753d01..2f2bf94c22 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -1176,20 +1176,12 @@ class _TestPool(BaseTestCase): p.join() def test_terminate(self): - if self.TYPE == 'manager': - # On Unix a forked process increfs each shared object to - # which its parent process held a reference. If the - # forked process gets terminated then there is likely to - # be a reference leak. So to prevent - # _TestZZZNumberOfObjects from failing we skip this test - # when using a manager. - return - - result = self.pool.map_async( + p = self.Pool(4) + result = p.map_async( time.sleep, [0.1 for i in range(10000)], chunksize=1 ) - self.pool.terminate() - join = TimingWrapper(self.pool.join) + p.terminate() + join = TimingWrapper(p.join) join() self.assertTrue(join.elapsed < 0.2) -- 2.50.1