diff options
author | Dana Powers <dana.powers@rd.io> | 2015-06-08 21:05:40 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2015-06-08 21:05:47 -0700 |
commit | d262107aa870a72a15f7da097c116a8c6dcea0cd (patch) | |
tree | 2ca68b28cbfce6974e84c561ea4bc193b02f72fd /test/fixtures.py | |
parent | 3d4d98ed78414af0c4330f056a3ae6bcf79ed11c (diff) | |
download | kafka-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.py | 14 |
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 |