Skip to content

Commit

Permalink
ci: TestUtils.py: Fix process matching in ssh_force_kill method
Browse files Browse the repository at this point in the history
* Updated `pgrep` to use the `-f` option for matching the full command
  line instead of just the process name.
* Ensures more reliable process identification, especially for cases
  where only part of the command line matches the specified text.
  • Loading branch information
psaavedra committed Jan 25, 2025
1 parent 68e52d1 commit 0fff346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .ci/robot_framework/libs/TestUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def ssh_command_in_background(self, ip, command):
def ssh_force_kill(self, ip, text):
"""Force kill all related process."""
print(f"RUN: Killing all '{text}' related processes ...")
command = f"pgrep {text} && pgrep {text} | xargs kill -9 || echo '{text} not running'"
command = f"pgrep -f {text} && pgrep -f {text} | xargs kill -9 || echo '{text} not running'"
return self.ssh_command(ip, command, quiet=True)

def ssh_reboot_force_reboot(self, ip):
Expand Down

0 comments on commit 0fff346

Please sign in to comment.