Skip to content

Commit

Permalink
tests/redpanda: do not include command with no args into pid list
Browse files Browse the repository at this point in the history
When `ps` is unable to determine process arguments it wraps the command
name in square brackets like this:
```
262250 pts/278  R+     0:00 [redpanda]
```

this was incorrectly interpreted as running Redpanda, the node was never
brought back up.
Fixed issue by filtering out incorrect `ps` output lines.

Fixes: redpanda-data#8753

Signed-off-by: Michal Maslanka <[email protected]>
  • Loading branch information
mmaslankaprv committed Apr 18, 2023
1 parent 0237b70 commit 81c37c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/rptest/services/redpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ def remove_local_data(self, node):

def redpanda_pid(self, node):
try:
cmd = "ps ax | grep -i 'redpanda' | grep -v grep | grep -v 'version' | awk '{print $1}'"
cmd = "ps ax | grep -i 'redpanda' | grep -v grep | grep -v 'version'| grep -v \"]\" | awk '{print $1}'"
for p in node.account.ssh_capture(cmd,
allow_fail=True,
callback=int):
Expand Down

0 comments on commit 81c37c5

Please sign in to comment.