diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-09-29 01:59:08 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-09-29 01:59:08 +0000 |
commit | 79542ce2f51eda456ee758fd4bb3da60796b062e (patch) | |
tree | 8f79f89ec6ba3759ae5d934f4607cfb4750069e5 | |
parent | 4728497e7697fb70ec2301f60e8819c0a135cce8 (diff) | |
download | qpid-python-79542ce2f51eda456ee758fd4bb3da60796b062e.tar.gz |
Added a failover test case that uses durable subscriptions.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1002448 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | java/testkit/testkit.py | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/java/testkit/testkit.py b/java/testkit/testkit.py index 4e6ee9b586..5f83156c38 100755 --- a/java/testkit/testkit.py +++ b/java/testkit/testkit.py @@ -213,4 +213,40 @@ class SoakTest(JavaClientTest): self.verify(receiver,sender) if error_msg: - raise Exception(error_msg) + raise Exception(error_msg) + + def test_failover_with_durablesub(self): + cluster = self.cluster(4, expect=EXPECT_EXIT_FAIL) + p = cluster[0].port() + self.start_error_watcher(broker=cluster[0]) + receiver = self.popen(self.client(receiver=True, + ssn_per_con=1, + port=p, + jms_durable_sub=True, + test_name=self.id()), + expect=EXPECT_RUNNING) + + sender = self.popen(self.client(sender=True, + ssn_per_con=1, + port=p, + test_name=self.id()), + expect=EXPECT_RUNNING) + + # grace period for java clients to get the failover properly setup. + time.sleep(30) + error_msg=None + # Kill original brokers, start new ones. + try: + for i in range(8): + cluster[i].kill() + b=cluster.start() + self.monitor_clients(broker=b,run_time=30,error_ck_freq=30) + except ConnectError, e1: + error_msg = "Unable to connect to new cluster node : " + traceback.format_exc(e1) + + except SessionError, e2: + error_msg = "Session error while connected to new cluster node : " + traceback.format_exc(e2) + + self.verify(receiver,sender) + if error_msg: + raise Exception(error_msg) |