Skip to content

Commit

Permalink
tests/kafka_cli_consumer: added wait_for_started method
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Maslanka <michal@vectorized.io>
  • Loading branch information
mmaslankaprv committed May 16, 2022
1 parent b6f7030 commit 4194e66
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/rptest/services/kafka_cli_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ def wait_for_messages(self, messages, timeout=30):
timeout,
backoff_sec=2)

def wait_for_started(self, timeout=10):
def all_started():
return all([
len(node.account.java_pids("ConsoleConsumer")) == 1
for node in self.nodes
])

wait_until(all_started, timeout, backoff_sec=1)

def stop_node(self, node):
self._stopping.set()
node.account.kill_process("java", clean_shutdown=True)

0 comments on commit 4194e66

Please sign in to comment.