mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-14 16:19:17 +03:00
fix(exec): terminate one-shot process trees on cleanup
Run one-shot commands in their own process tree and terminate all descendants after timeout, cancellation, or unexpected failures. Co-authored-by: TRAE CLI <noreply@bytedance.com>
This commit is contained in:
committed by
chengyongru
co-authored by
TRAE CLI
parent
abfcdd481a
commit
d64b84604c
@@ -302,7 +302,9 @@ class TestPathAppendPlatform:
|
||||
captured_cmd = None
|
||||
captured_env = {}
|
||||
|
||||
async def capture_spawn(cmd, cwd, env, shell_program=None, login=True):
|
||||
async def capture_spawn(
|
||||
cmd, cwd, env, shell_program=None, login=True, *, process_tree=False,
|
||||
):
|
||||
nonlocal captured_cmd
|
||||
captured_cmd = cmd
|
||||
captured_env.update(env)
|
||||
@@ -331,7 +333,9 @@ class TestPathAppendPlatform:
|
||||
captured_cmd = None
|
||||
captured_env = {}
|
||||
|
||||
async def capture_spawn(cmd, cwd, env, shell_program=None, login=True, *, stdin=None):
|
||||
async def capture_spawn(
|
||||
cmd, cwd, env, shell_program=None, login=True, *, stdin=None, process_tree=False,
|
||||
):
|
||||
nonlocal captured_cmd
|
||||
captured_cmd = cmd
|
||||
captured_env.update(env)
|
||||
@@ -359,7 +363,9 @@ class TestPathAppendPlatform:
|
||||
captured_cmd = None
|
||||
captured_env = {}
|
||||
|
||||
async def capture_spawn(cmd, cwd, env, shell_program=None, login=True, *, stdin=None):
|
||||
async def capture_spawn(
|
||||
cmd, cwd, env, shell_program=None, login=True, *, stdin=None, process_tree=False,
|
||||
):
|
||||
nonlocal captured_cmd
|
||||
captured_cmd = cmd
|
||||
captured_env.update(env)
|
||||
@@ -389,7 +395,9 @@ class TestPathAppendPlatform:
|
||||
|
||||
captured_env = {}
|
||||
|
||||
async def capture_spawn(cmd, cwd, env, shell_program=None, login=True):
|
||||
async def capture_spawn(
|
||||
cmd, cwd, env, shell_program=None, login=True, *, process_tree=False,
|
||||
):
|
||||
captured_env.update(env)
|
||||
return mock_proc
|
||||
|
||||
@@ -412,7 +420,9 @@ class TestPathAppendPlatform:
|
||||
|
||||
captured_env = {}
|
||||
|
||||
async def capture_spawn(cmd, cwd, env, shell_program=None, login=True, *, stdin=None):
|
||||
async def capture_spawn(
|
||||
cmd, cwd, env, shell_program=None, login=True, *, stdin=None, process_tree=False,
|
||||
):
|
||||
captured_env.update(env)
|
||||
return mock_proc
|
||||
|
||||
@@ -558,7 +568,9 @@ class TestExecuteEndToEnd:
|
||||
mock_proc.returncode = 0
|
||||
captured_login = []
|
||||
|
||||
async def capture_spawn(cmd, cwd, env, shell_program=None, login=None, *, stdin=None):
|
||||
async def capture_spawn(
|
||||
cmd, cwd, env, shell_program=None, login=None, *, stdin=None, process_tree=False,
|
||||
):
|
||||
captured_login.append(login)
|
||||
return mock_proc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user