changeset: 87313:086865ceefe1 branch: 2.7 parent: 87306:03a32ead9c7d user: Richard Oudkerk date: Thu Nov 21 16:35:12 2013 +0000 files: Lib/test/test_multiprocessing.py description: Issue #19599: Use a separate pool for test_terminate(). diff -r 03a32ead9c7d -r 086865ceefe1 Lib/test/test_multiprocessing.py --- a/Lib/test/test_multiprocessing.py Thu Nov 21 11:04:37 2013 +0200 +++ b/Lib/test/test_multiprocessing.py Thu Nov 21 16:35:12 2013 +0000 @@ -1176,20 +1176,12 @@ 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)