Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ducky: pin to the latest version #6003

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions tests/rptest/services/kafka_cli_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def script(self):

def _worker(self, _, node):
self._done = False
self.logger.debug("%s: starting worker thread" % self.who_am_i(node))
self._stopping.clear()
try:

Expand Down Expand Up @@ -80,6 +81,8 @@ def _worker(self, _, node):
f"[{self._instance_name}] consumed: '{line}'")
self._messages.append(line)
except:
self.logger.exception("%s: something is wrong" %
self.who_am_i(node))
Comment on lines +84 to +85
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be conditional on !self._stopping.is_set()?

if self._stopping.is_set():
# Expect a non-zero exit code when killing during teardown
pass
Expand All @@ -95,15 +98,23 @@ def wait_for_messages(self, messages, timeout=30):

def wait_for_started(self, timeout=10):
def all_started():
return all([
len(node.account.java_pids("ConsoleConsumer")) == 1
for node in self.nodes
])
for node in self.nodes:
pids = node.account.java_pids("ConsoleConsumer")
self.logger.debug(
"%s: ConsoleConsumer pids: %s" %
(self.who_am_i(node), ",".join(map(str, pids))))
if len(pids) != 1:
return False
return True

wait_until(all_started, timeout, backoff_sec=1)

def stop_node(self, node):
self._stopping.set()
self.logger.exception("%s: stop requested" % self.who_am_i(node))
pids = node.account.java_pids("ConsoleConsumer")
self.logger.debug("%s: ConsoleConsumer pids: %s" %
(self.who_am_i(node), ",".join(map(str, pids))))
node.account.kill_process("java", clean_shutdown=True)

try:
Expand Down