diff --git a/testgres/node.py b/testgres/node.py index 5d95857..b9bf989 100644 --- a/testgres/node.py +++ b/testgres/node.py @@ -351,7 +351,7 @@ def _try_shutdown(self, max_attempts, with_force=False): # If force stopping is enabled and PID is valid if with_force and node_pid != 0: # If we couldn't stop the node - p_status_output = self.os_ops.exec_command(cmd=f'ps -p {node_pid}', shell=True).decode('utf-8') + p_status_output = self.os_ops.exec_command(cmd=f'ps -o pid= -p {node_pid}', shell=True, ignore_errors=True).decode('utf-8') if self.status() != NodeStatus.Stopped and p_status_output and str(node_pid) in p_status_output: try: eprint(f'Force stopping node {self.name} with PID {node_pid}')