summaryrefslogtreecommitdiff
path: root/test/fixtures.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@rd.io>2015-06-08 21:05:40 -0700
committerDana Powers <dana.powers@rd.io>2015-06-08 21:05:47 -0700
commitd262107aa870a72a15f7da097c116a8c6dcea0cd (patch)
tree2ca68b28cbfce6974e84c561ea4bc193b02f72fd /test/fixtures.py
parent3d4d98ed78414af0c4330f056a3ae6bcf79ed11c (diff)
downloadkafka-python-d262107aa870a72a15f7da097c116a8c6dcea0cd.tar.gz
Retry with shorter 5sec timeout when trying to open() fixtures
- this is intended to reduce flapping tests caused by intermittent - fixture startup issues on travis-ci
Diffstat (limited to 'test/fixtures.py')
-rw-r--r--test/fixtures.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/fixtures.py b/test/fixtures.py
index 90d01f1..4231452 100644
--- a/test/fixtures.py
+++ b/test/fixtures.py
@@ -126,8 +126,11 @@ class ZookeeperFixture(Fixture):
# Party!
self.out("Starting...")
- self.child.start()
- self.child.wait_for(r"binding to port")
+ while True:
+ self.child.start()
+ if self.child.wait_for(r"binding to port", timeout=5):
+ break
+ self.child.stop()
self.out("Done!")
def close(self):
@@ -222,8 +225,11 @@ class KafkaFixture(Fixture):
self.out("Done!")
self.out("Starting...")
- self.child.start()
- self.child.wait_for(r"\[Kafka Server %d\], Started" % self.broker_id)
+ while True:
+ self.child.start()
+ if self.child.wait_for(r"\[Kafka Server %d\], Started" % self.broker_id, timeout=5):
+ break
+ self.child.stop()
self.out("Done!")
self.running = True