diff options
author | Thomas Moreau <thomas.moreau.2010@gmail.com> | 2018-03-21 16:50:28 +0100 |
---|---|---|
committer | Antoine Pitrou <pitrou@free.fr> | 2018-03-21 16:50:28 +0100 |
commit | e2f33add635df4fde81be9960bab367e010c19bf (patch) | |
tree | 26f61daafe01350703a9f0d40f962e5789b086a7 /Lib/test/_test_multiprocessing.py | |
parent | 9308dea3e1fd565d50a76a667e4e8ef0568b7053 (diff) | |
download | cpython-git-e2f33add635df4fde81be9960bab367e010c19bf.tar.gz |
bpo-33078 - Fix queue size on pickling error (GH-6119)
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 940fe584e7..c787702f1d 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -1056,6 +1056,19 @@ class _TestQueue(BaseTestCase): self.assertTrue(q.get(timeout=1.0)) close_queue(q) + with test.support.captured_stderr(): + # bpo-33078: verify that the queue size is correctly handled + # on errors. + q = self.Queue(maxsize=1) + q.put(NotSerializable()) + q.put(True) + self.assertEqual(q.qsize(), 1) + # bpo-30595: use a timeout of 1 second for slow buildbots + self.assertTrue(q.get(timeout=1.0)) + # Check that the size of the queue is correct + self.assertEqual(q.qsize(), 0) + close_queue(q) + def test_queue_feeder_on_queue_feeder_error(self): # bpo-30006: verify feeder handles exceptions using the # _on_queue_feeder_error hook. |