diff options
author | Gordon Sim <gsim@apache.org> | 2006-10-30 19:28:40 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2006-10-30 19:28:40 +0000 |
commit | 280bff8336167763e11c02ce4acc11bf9b90558d (patch) | |
tree | 43cf77030d028691b3d298c4488dd24f15024cef /qpid/python | |
parent | 9b604959c9adc63c9e855cb761c4004f5c3b34e8 (diff) | |
download | qpid-python-280bff8336167763e11c02ce4acc11bf9b90558d.tar.gz |
c++ broker now passes the basic tx tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@469243 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r-- | qpid/python/cpp_failing.txt | 2 | ||||
-rw-r--r-- | qpid/python/tests/tx.py | 31 |
2 files changed, 29 insertions, 4 deletions
diff --git a/qpid/python/cpp_failing.txt b/qpid/python/cpp_failing.txt index 167fc9cce5..e69de29bb2 100644 --- a/qpid/python/cpp_failing.txt +++ b/qpid/python/cpp_failing.txt @@ -1,2 +0,0 @@ -tests.tx.TxTests.test_commit -tests.tx.TxTests.test_rollback diff --git a/qpid/python/tests/tx.py b/qpid/python/tests/tx.py index b1030bf602..c84a228f2a 100644 --- a/qpid/python/tests/tx.py +++ b/qpid/python/tests/tx.py @@ -110,9 +110,8 @@ class TxTests(TestBase): channel.basic_publish(routing_key=key, exchange="amq.direct", content=Content("Message 6")) channel.basic_publish(routing_key=topic, exchange="amq.topic", content=Content("Message 7")) - channel.tx_select() - + #consume and ack messages sub_a = channel.basic_consume(queue=name_a, no_ack=False) queue_a = self.client.queue(sub_a.consumer_tag) @@ -141,3 +140,31 @@ class TxTests(TestBase): channel.basic_publish(routing_key=name_a, content=Content("TxMessage 7")) return queue_a, queue_b, queue_c + + def test_commit_overlapping_acks(self): + """ + Test that logically 'overlapping' acks do not cause errors on commit + """ + channel = self.channel + channel.queue_declare(queue="commit-overlapping", exclusive=True) + for i in range(1, 10): + channel.basic_publish(routing_key="commit-overlapping", content=Content("Message %d" % i)) + + + channel.tx_select() + + sub = channel.basic_consume(queue="commit-overlapping", no_ack=False) + queue = self.client.queue(sub.consumer_tag) + for i in range(1, 10): + msg = queue.get(timeout=1) + self.assertEqual("Message %d" % i, msg.content.body) + if i in [3, 6, 10]: + channel.basic_ack(delivery_tag=msg.delivery_tag) + + channel.tx_commit() + + #check all have been acked: + try: + extra = queue.get(timeout=1) + self.fail("Got unexpected message: " + extra.content.body) + except Empty: None |