From e06af5343a55cf8d03e32a645ee970d872cb9ba0 Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Mon, 23 Oct 2017 21:43:53 -0700 Subject: Add fixture support for upcoming 1.0.0 broker release (#1275) --- test/fixtures.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/fixtures.py b/test/fixtures.py index c131f5a..62a1980 100644 --- a/test/fixtures.py +++ b/test/fixtures.py @@ -223,6 +223,11 @@ class KafkaFixture(Fixture): self.transport = transport.upper() self.ssl_dir = self.test_resource('ssl') + # TODO: checking for port connection would be better than scanning logs + # until then, we need the pattern to work across all supported broker versions + # The logging format changed slightly in 1.0.0 + self.start_pattern = r"\[Kafka ?Server (id=)?%d\],? started" % broker_id + self.zk_host = zk_host self.zk_port = zk_port self.zk_chroot = zk_chroot @@ -303,8 +308,7 @@ class KafkaFixture(Fixture): self.child = SpawnedService(args, env) self.child.start() timeout = min(timeout, max(end_at - time.time(), 0)) - if self.child.wait_for(r"\[Kafka Server %d\], Started" % - self.broker_id, timeout=timeout): + if self.child.wait_for(self.start_pattern, timeout=timeout): break self.child.dump_logs() self.child.stop() -- cgit v1.2.1