diff options
| author | Alan Conway <aconway@apache.org> | 2013-09-12 20:14:17 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2013-09-12 20:14:17 +0000 |
| commit | 86f1dcbc82f040b592f650bbee4c16ad01041503 (patch) | |
| tree | 463d0477c4ed0ea702274a59fd77c8caf9e26ba7 /qpid/cpp/src/tests/ha_test.py | |
| parent | 52c856bbd69641484ab0c442ecb110e650a5870e (diff) | |
| download | qpid-python-86f1dcbc82f040b592f650bbee4c16ad01041503.tar.gz | |
QPID-4944: HA re-enable test_failover_send_receive
Appears to have been fixed at this point on trunk, not clear which checkins are
responsible. Test ran for 48 hours with no failures.
Other minor changes:
- Enable test_failover_send_receive
- Increase heartbeat interval.
- Reduce capacity of senders in failover test to be more aggressive.
- Use HaBrokerTest as test base
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1522711 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ha_test.py')
| -rwxr-xr-x | qpid/cpp/src/tests/ha_test.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/qpid/cpp/src/tests/ha_test.py b/qpid/cpp/src/tests/ha_test.py index 3280540db7..3b5874875a 100755 --- a/qpid/cpp/src/tests/ha_test.py +++ b/qpid/cpp/src/tests/ha_test.py @@ -119,6 +119,9 @@ class HaBroker(Broker): """Start a broker with HA enabled @param client_cred: (user, password, mechanism) for admin clients started by the HaBroker. """ + + heartbeat=2 + def __init__(self, test, ha_port=None, args=[], brokers_url=None, ha_cluster=True, ha_replicate="all", client_credentials=None, **kwargs): assert BrokerTest.ha_lib, "Cannot locate HA plug-in" @@ -130,7 +133,7 @@ class HaBroker(Broker): "--link-maintenance-interval=0.1", # Heartbeat and negotiate time are needed so that a broker wont # stall on an address that doesn't currently have a broker running. - "--link-heartbeat-interval=1", + "--link-heartbeat-interval=%s"%(HaBroker.heartbeat), "--max-negotiate-time=1000", "--ha-cluster=%s"%ha_cluster] if ha_replicate is not None: @@ -157,15 +160,18 @@ acl allow all all self.client_credentials = client_credentials self.ha_port = ha_port - def __str__(self): return Broker.__str__(self) + def __repr__(self): return "<HaBroker:%s:%d>"%(self.log, self.port()) def qpid_ha(self, args): - cred = self.client_credentials - url = self.host_port() - if cred: - url =cred.add_user(url) - args = args + ["--sasl-mechanism", cred.mechanism] - self.qpid_ha_script.main_except(["", "-b", url]+args) + try: + cred = self.client_credentials + url = self.host_port() + if cred: + url =cred.add_user(url) + args = args + ["--sasl-mechanism", cred.mechanism] + self.qpid_ha_script.main_except(["", "-b", url]+args) + except Exception, e: + raise Exception("Error in qpid_ha -b %s %s: %s"%(url, args,e)) def promote(self): self.ready(); self.qpid_ha(["promote"]) def set_public_url(self, url): self.qpid_ha(["set", "--public-url", url]) |
