fix(exec): clean up sessions on shutdown
This commit is contained in:
@@ -114,6 +114,22 @@ class TestSpawnUnix:
|
||||
kwargs = mock_exec.call_args[1]
|
||||
assert kwargs["stdin"] == asyncio.subprocess.DEVNULL
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_process_tree_starts_new_session(self):
|
||||
with (
|
||||
patch("nanobot.agent.tools.shell._IS_WINDOWS", False),
|
||||
patch("asyncio.create_subprocess_exec", new_callable=AsyncMock) as mock_exec,
|
||||
):
|
||||
mock_exec.return_value = AsyncMock()
|
||||
await ExecTool._spawn(
|
||||
"echo hi",
|
||||
"/tmp",
|
||||
{"HOME": "/tmp"},
|
||||
process_tree=True,
|
||||
)
|
||||
|
||||
assert mock_exec.call_args.kwargs["start_new_session"] is True
|
||||
|
||||
|
||||
class TestSpawnWindows:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user