From 81c37c5aea25c819edc401f2fbd44312bc45904b Mon Sep 17 00:00:00 2001 From: Michal Maslanka Date: Tue, 18 Apr 2023 13:01:52 +0200 Subject: [PATCH] tests/redpanda: do not include command with no args into pid list 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: #8753 Signed-off-by: Michal Maslanka --- tests/rptest/services/redpanda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/rptest/services/redpanda.py b/tests/rptest/services/redpanda.py index b705e56d8553..156c9d04fd1e 100644 --- a/tests/rptest/services/redpanda.py +++ b/tests/rptest/services/redpanda.py @@ -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):