summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-11-21 16:35:12 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2013-11-21 16:35:12 (GMT)
commit6d24a6e0bbd1e073ce183d15463066d6ae59dbd4 (patch)
treed1b62d1729616bb0814584b490e1b96be2485bef
parent5397c97451413b544593313651964facf9502c4a (diff)
downloadcpython-6d24a6e0bbd1e073ce183d15463066d6ae59dbd4.zip
cpython-6d24a6e0bbd1e073ce183d15463066d6ae59dbd4.tar.gz
cpython-6d24a6e0bbd1e073ce183d15463066d6ae59dbd4.tar.bz2
Issue #19599: Use a separate pool for test_terminate().
-rw-r--r--Lib/test/test_multiprocessing.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 3a43753..2f2bf94 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)