Skip to content

Commit

Permalink
[Test] Rework kill process tree utility
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Dec 31, 2022
1 parent a953819 commit 3a4c011
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/functional/lib/rspamd.py
Expand Up @@ -240,13 +240,14 @@ def shutdown_process_with_children(pid):
process = psutil.Process(pid=pid)
except psutil.NoSuchProcess:
return
children = process.children(recursive=False)
children = process.children(recursive=True)
shutdown_process(process)
for child in children:
try:
shutdown_process(child)
except:
child.kill()
except psutil.NoSuchProcess:
pass
psutil.wait_procs(children, timeout=KILL_WAIT)

def write_to_stdin(process_handle, text):
if not isinstance(text, bytes):
Expand Down

0 comments on commit 3a4c011

Please sign in to comment.