summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/ha_tests.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-08-01 20:27:39 +0000
committerAlan Conway <aconway@apache.org>2013-08-01 20:27:39 +0000
commit09ba98e9af327f339de442512a288190893f2c92 (patch)
tree82738a1e51cbf888eab5c497bd2fa1317a32515a /qpid/cpp/src/tests/ha_tests.py
parent014f0f39d9cfb6242bea173eadbc0f8229ba5f7f (diff)
downloadqpid-python-09ba98e9af327f339de442512a288190893f2c92.tar.gz
QPID-4327: HA TX transactions, blocking wait for prepare
Backups send prepare messages to primary, primary delays completion of prepare till all are prepared (or there is a failure). This is NOT the production solution - blocking could cause a deadlock. We need to introduce asynchronous completion of prepare without blocking. This interim solution allows testing on other aspects of TX support. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1509424 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ha_tests.py')
-rwxr-xr-xqpid/cpp/src/tests/ha_tests.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/qpid/cpp/src/tests/ha_tests.py b/qpid/cpp/src/tests/ha_tests.py
index 55715639a4..e97614d785 100755
--- a/qpid/cpp/src/tests/ha_tests.py
+++ b/qpid/cpp/src/tests/ha_tests.py
@@ -1381,7 +1381,18 @@ class TransactionTests(BrokerTest):
self.assertEqual(open_read(cluster[0].store_log), expect)
self.assertEqual(open_read(cluster[1].store_log), expect)
-# FIXME aconway 2013-07-23: test with partial acknowledgement.
+ def test_tx_backup_fail(self):
+ # FIXME aconway 2013-07-31: check exception types, reduce timeout.
+ cluster = HaCluster(
+ self, 2, test_store=True, s_args=[[],["--test-store-throw=bang"]])
+ c = cluster[0].connect()
+ tx = c.session(transactional=True)
+ s = tx.sender("q;{create:always,node:{durable:true}}")
+ for m in ["foo","bang","bar"]: s.send(Message(m, durable=True))
+ self.assertRaises(Exception, tx.commit)
+ for b in cluster: b.assert_browse_backup("q", [])
+ self.assertEqual(open_read(cluster[0].store_log), "<begin tx 1>\n<abort tx=1>\n")
+ self.assertEqual(open_read(cluster[1].store_log), "<begin tx 1>\n<enqueue q foo tx=1>\n<enqueue q bang tx=1>\n<abort tx=1>\n")
if __name__ == "__main__":
outdir = "ha_tests.tmp"