From ecde9757abc26697220e00d3306a11919f2fe2ca Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 25 Feb 2009 15:46:04 +0000 Subject: Fix for bug in credit reallocation, along with test from rafaels@redhat.com that reproduces it. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@747833 13f79535-47bb-0310-9956-ffa450edef68 --- python/tests_0-10/message.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'python') diff --git a/python/tests_0-10/message.py b/python/tests_0-10/message.py index cbcef5602f..f2e2dc88ee 100644 --- a/python/tests_0-10/message.py +++ b/python/tests_0-10/message.py @@ -462,6 +462,42 @@ class MessageTests(TestBase010): self.assertDataEquals(session, q.get(timeout = 1), "abcdefgh") self.assertEmpty(q) + def test_window_flush_ack_flow(self): + """ + Test basic window based flow control with unit = bytes + """ + #declare an exclusive queue + ssn = self.session + ssn.queue_declare(queue = "q", exclusive=True, auto_delete=True) + #create consumer + ssn.message_subscribe(queue = "q", destination = "c", + accept_mode=ssn.accept_mode.explicit) + ssn.message_set_flow_mode(flow_mode = ssn.flow_mode.window, destination = "c") + + #send message A + ssn.message_transfer(message=Message(ssn.delivery_properties(routing_key="q"), "A")) + + for unit in ssn.credit_unit.values(): + ssn.message_flow("c", unit, 0xFFFFFFFFL) + + q = ssn.incoming("c") + msgA = q.get(timeout=10) + + ssn.message_flush(destination="c") + + # XXX + ssn.receiver._completed.add(msgA.id) + ssn.channel.session_completed(ssn.receiver._completed) + ssn.message_accept(RangedSet(msgA.id)) + + for unit in ssn.credit_unit.values(): + ssn.message_flow("c", unit, 0xFFFFFFFFL) + + #send message B + ssn.message_transfer(message=Message(ssn.delivery_properties(routing_key="q"), "B")) + + msgB = q.get(timeout=10) + def test_subscribe_not_acquired(self): """ Test the not-acquired modes works as expected for a simple case -- cgit v1.2.1