Skip to content

Commit 177724b

Browse files
authored
Fix node.py: try_shutdown and cleanup (#145)
1 parent 78603f8 commit 177724b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testgres/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def _try_shutdown(self, max_attempts, with_force=False):
351351
# If force stopping is enabled and PID is valid
352352
if with_force and node_pid != 0:
353353
# If we couldn't stop the node
354-
p_status_output = self.os_ops.exec_command(cmd=f'ps -p {node_pid}', shell=True).decode('utf-8')
354+
p_status_output = self.os_ops.exec_command(cmd=f'ps -o pid= -p {node_pid}', shell=True, ignore_errors=True).decode('utf-8')
355355
if self.status() != NodeStatus.Stopped and p_status_output and str(node_pid) in p_status_output:
356356
try:
357357
eprint(f'Force stopping node {self.name} with PID {node_pid}')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy