diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-12-31 21:35:56 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-12-31 21:35:56 +0000 |
commit | 3a4c01166ffc63c0b92e10f3a6ff21f85eb43449 (patch) | |
tree | 4197ada6301b2fc4926034d746876ed2ce00ab38 /test | |
parent | a9538199ddfd1cf0a932d3150c0f417293a6f7ca (diff) | |
download | rspamd-3a4c01166ffc63c0b92e10f3a6ff21f85eb43449.tar.gz rspamd-3a4c01166ffc63c0b92e10f3a6ff21f85eb43449.zip |
[Test] Rework kill process tree utility
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/lib/rspamd.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/functional/lib/rspamd.py b/test/functional/lib/rspamd.py index 2bb5ce3d2..49c21a449 100644 --- a/test/functional/lib/rspamd.py +++ b/test/functional/lib/rspamd.py @@ -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): |