summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2012-06-12 21:21:09 +0000
committerAlan Conway <aconway@apache.org>2012-06-12 21:21:09 +0000
commit2bb43aedeb59eaa9eaf79407ba8fb80f934d632e (patch)
tree731597e12dbe4ce54ba721781e70ae9a3ed42f75 /qpid/cpp/src/tests
parent314095b5a1f0eeaaafad301954e2137ff543e9a7 (diff)
downloadqpid-python-2bb43aedeb59eaa9eaf79407ba8fb80f934d632e.tar.gz
QPID-3603: HA bug fixes around transition to ready status
- Simplify QueueGuard::firstSafe calculation. - Fix error in setting initial queues - was not checking if replicated. - Send ready status to backups. Tests hang, deadlock in opened()->RemoteBackup on primary? - Fix deadlock in QueueGuard. - Don't start guards inside ConnectionObserver::opened. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1349547 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
-rw-r--r--qpid/cpp/src/tests/brokertest.py2
-rwxr-xr-xqpid/cpp/src/tests/ha_tests.py12
2 files changed, 9 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/brokertest.py b/qpid/cpp/src/tests/brokertest.py
index fcc5671c90..1dac3d579c 100644
--- a/qpid/cpp/src/tests/brokertest.py
+++ b/qpid/cpp/src/tests/brokertest.py
@@ -243,7 +243,7 @@ class Broker(Popen):
_broker_count = 0
_log_count = 0
- def __str__(self): return "Broker<%s %s>"%(self.name, self.pname)
+ def __str__(self): return "Broker<%s %s :%d>"%(self.name, self.pname, self.port())
def find_log(self):
self.log = "%03d:%s.log" % (Broker._log_count, self.name)
diff --git a/qpid/cpp/src/tests/ha_tests.py b/qpid/cpp/src/tests/ha_tests.py
index 2576a2fa6e..06b2aec3cd 100755
--- a/qpid/cpp/src/tests/ha_tests.py
+++ b/qpid/cpp/src/tests/ha_tests.py
@@ -65,6 +65,8 @@ class HaBroker(Broker):
self.qpid_ha_script=import_script(self.qpid_ha_path)
self._agent = None
+ def __str__(self): return Broker.__str__(self)
+
def qpid_ha(self, args): self.qpid_ha_script.main(["", "-b", self.host_port()]+args)
def promote(self): self.qpid_ha(["promote"])
@@ -78,7 +80,7 @@ class HaBroker(Broker):
def ha_status(self): return self.agent().getHaBroker().status
def wait_status(self, status):
- assert retry(lambda: self.ha_status() == status), "%r != %r"%(self.ha_status(), status)
+ assert retry(lambda: self.ha_status() == status), "%s, %r != %r"%(self, self.ha_status(), status)
# FIXME aconway 2012-05-01: do direct python call to qpid-config code.
def qpid_config(self, args):
@@ -738,10 +740,12 @@ class LongTests(BrokerTest):
for r in receivers: r.receiver.assert_running()
n = receivers[0].received
# FIXME aconway 2012-05-01: don't kill primary till it's active
- # otherwise we can lose messages. When we implement non-promotion
- # of catchup brokers we can make this stronger: wait only for
- # there to be at least one ready backup.
+ # and backups are ready, otherwise we can lose messages. When we
+ # implement non-promotion of catchup brokers we can make this
+ # stronger: wait only for there to be at least one ready backup.
brokers[i%3].wait_status("active")
+ brokers[(i+1)%3].wait_status("ready")
+ brokers[(i+2)%3].wait_status("ready")
brokers.bounce(i%3)
i += 1
def enough(): # Verify we're still running