diff options
| author | Dana Powers <dana.powers@gmail.com> | 2017-10-23 15:20:25 -0700 |
|---|---|---|
| committer | Dana Powers <dana.powers@gmail.com> | 2017-10-23 15:20:25 -0700 |
| commit | 875d9ef4d531a19d82023220354f94a8d3e53e89 (patch) | |
| tree | c24feb27cff8e1cd98985b77518d2199675a3a94 | |
| parent | a345dcd2ca1b0f8934864c512a4a78c65034dd36 (diff) | |
| download | kafka-python-875d9ef4d531a19d82023220354f94a8d3e53e89.tar.gz | |
Update kafka fixture pattern to support upcoming 1.0.0 release
| -rw-r--r-- | test/fixtures.py | 8 |
1 files changed, 6 insertions, 2 deletions
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() |
