summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-10-28 23:11:58 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2013-10-28 23:11:58 (GMT)
commite90cedb71102c78b93839fd282f53c618defc023 (patch)
tree5fdf60f355610d7e441f97316947da1b9035e204 /Lib/test
parent3797065ac55997741fd625a30a8308c04ee5c9b9 (diff)
downloadcpython-e90cedb71102c78b93839fd282f53c618defc023.zip
cpython-e90cedb71102c78b93839fd282f53c618defc023.tar.gz
cpython-e90cedb71102c78b93839fd282f53c618defc023.tar.bz2
Issue #19425 -- a pickling error should not cause pool to hang.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_multiprocessing.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index d5582aa..d6e530d 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1691,6 +1691,16 @@ class _TestPool(BaseTestCase):
self.assertEqual(2, len(call_args))
self.assertIsInstance(call_args[1], ValueError)
+ def test_map_unplicklable(self):
+ # Issue #19425 -- failure to pickle should not cause a hang
+ if self.TYPE == 'threads':
+ return
+ class A(object):
+ def __reduce__(self):
+ raise RuntimeError('cannot pickle')
+ with self.assertRaises(RuntimeError):
+ self.pool.map(sqr, [A()]*10)
+
def test_map_chunksize(self):
try:
self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)