summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-03-04 15:35:04 +0000
committerAlan Conway <aconway@apache.org>2010-03-04 15:35:04 +0000
commitd350bc1095314da7854a3a8d3a148f76c9668f7b (patch)
tree532c9445766fdc9000b7a4802d802e32945ccc3c /python
parent7505750a634eada9e6104b32b69225bbebd38318 (diff)
downloadqpid-python-d350bc1095314da7854a3a8d3a148f76c9668f7b.tar.gz
Increase timeout for python cluster tests, was timing out prematurely in some tests.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@919024 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/brokertest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/qpid/brokertest.py b/python/qpid/brokertest.py
index d0ec6e0932..4feb7413d1 100644
--- a/python/qpid/brokertest.py
+++ b/python/qpid/brokertest.py
@@ -89,7 +89,7 @@ def error_line(filename):
except: return ""
return result
-def retry(function, timeout=1, delay=.001):
+def retry(function, timeout=5, 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."""
@@ -188,7 +188,7 @@ class Popen(popen2.Popen3):
except:
self.unexpected("expected running, exit code %d" % self.wait())
else:
- retry(self.poll)
+ retry(lambda: self.poll() is not None)
if self.returncode is None: # Still haven't stopped
self.kill()
self.unexpected("still running")
@@ -357,7 +357,7 @@ class Broker(Popen):
def ready(self):
"""Wait till broker is ready to serve clients"""
# First make sure the broker is listening by checking the log.
- if not retry(lambda: self.log_ready()):
+ if not retry(self.log_ready):
raise Exception("Timed out waiting for broker %s" % self.name)
# Make a connection, this will wait for extended cluster init to finish.
try: self.connect().close()