summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/brokertest.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-06-20 15:20:21 +0000
committerAlan Conway <aconway@apache.org>2011-06-20 15:20:21 +0000
commited552685e7d21811fc6815116026eeb6a20b59c3 (patch)
tree5628778100fe2bad54979a41cdab381ba5266ecf /qpid/cpp/src/tests/brokertest.py
parentf1616d61d152fe80e87e99d73851ade5e58b2e23 (diff)
downloadqpid-python-ed552685e7d21811fc6815116026eeb6a20b59c3.tar.gz
QPID-3129: cluster_tests.LongTests.test_failover hangs
Problem: the first broker in the cluster could be killed before the receiver was connected, so the receiver could not fail-over, it didn't have a failover update. Fix: wait for the first message to be received by the receiver before starting the broker-kill loop. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1137657 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/brokertest.py')
-rw-r--r--qpid/cpp/src/tests/brokertest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/brokertest.py b/qpid/cpp/src/tests/brokertest.py
index 36c91489e2..0415a667a2 100644
--- a/qpid/cpp/src/tests/brokertest.py
+++ b/qpid/cpp/src/tests/brokertest.py
@@ -76,7 +76,7 @@ def error_line(filename, n=1):
except: return ""
return ":\n" + "".join(result)
-def retry(function, timeout=30, delay=.01):
+def retry(function, timeout=10, delay=.01):
"""Call function until it returns True or timeout expires.
Double the delay for each retry. Return True if function
returns true, False if timeout expires."""
@@ -509,7 +509,7 @@ class BrokerTest(TestCase):
actual_contents = self.browse(session, queue, timeout)
self.assertEqual(expect_contents, actual_contents)
-def join(thread, timeout=60):
+def join(thread, timeout=10):
thread.join(timeout)
if thread.isAlive(): raise Exception("Timed out joining thread %s"%thread)
@@ -619,13 +619,13 @@ class NumberedReceiver(Thread):
self.lock = Lock()
self.error = None
self.sender = sender
+ self.received = 0
def read_message(self):
return int(self.receiver.stdout.readline())
def run(self):
try:
- self.received = 0
m = self.read_message()
while m != -1:
self.receiver.assert_running()