[Python-checkins] cpython (2.7): Issue #19599: Use a separate pool for test_terminate().

richard.oudkerk python-checkins at python.org
Thu Nov 21 17:36:49 CET 2013


http://hg.python.org/cpython/rev/086865ceefe1
changeset:   87313:086865ceefe1
branch:      2.7
parent:      87306:03a32ead9c7d
user:        Richard Oudkerk <shibturn at gmail.com>
date:        Thu Nov 21 16:35:12 2013 +0000
summary:
  Issue #19599: Use a separate pool for test_terminate().

files:
  Lib/test/test_multiprocessing.py |  16 ++++------------
  1 files changed, 4 insertions(+), 12 deletions(-)


diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -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)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list