summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-10-30 19:28:40 +0000
committerGordon Sim <gsim@apache.org>2006-10-30 19:28:40 +0000
commita763706f6bafa2e2658343d3b9b9d4156361469a (patch)
treec934e18b66899ce6f882a814f5e9a0e9acc7ac76 /python
parentb0a120b4edfdb49a08bd7c8c2479e7b1cadc5233 (diff)
downloadqpid-python-a763706f6bafa2e2658343d3b9b9d4156361469a.tar.gz
c++ broker now passes the basic tx tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@469243 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/cpp_failing.txt2
-rw-r--r--python/tests/tx.py31
2 files changed, 29 insertions, 4 deletions
diff --git a/python/cpp_failing.txt b/python/cpp_failing.txt
index 167fc9cce5..e69de29bb2 100644
--- a/python/cpp_failing.txt
+++ b/python/cpp_failing.txt
@@ -1,2 +0,0 @@
-tests.tx.TxTests.test_commit
-tests.tx.TxTests.test_rollback
diff --git a/python/tests/tx.py b/python/tests/tx.py
index b1030bf602..c84a228f2a 100644
--- a/python/tests/tx.py
+++ b/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