mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
bpo-33078 - Fix queue size on pickling error (GH-6119)
This commit is contained in:
parent
9308dea3e1
commit
e2f33add63
3 changed files with 23 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue