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

[v22.3.x] ducktape: improve pid dectection v2 #11557

Merged
Merged
Changes from all commits
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
18 changes: 11 additions & 7 deletions tests/rptest/services/redpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -1771,13 +1771,17 @@ def redpanda_pid(self, node):
# we need to look for redpanda pid. pids() method returns pids of both
# nodejs server and redpanda
try:
cmd = "pgrep --exact redpanda"

for p in node.account.ssh_capture(cmd,
allow_fail=True,
callback=int):
return p

cmd = "pgrep --list-full --exact redpanda"
for line in node.account.ssh_capture(cmd,
allow_fail=True,
timeout_sec=10):
# Ignore SSH commands that lookup the version of redpanda
# by running `redpanda --version` like in `self.get_version(node)`
if "--version" in line:
continue
# The pid is listed first, that's all we need
return int(line.split()[0])
return None
except (RemoteCommandError, ValueError):
return None

Expand Down