From 114deefdfd224c071865e3249d9354e6eab51573 Mon Sep 17 00:00:00 2001 From: Liang Wu Date: Tue, 7 Apr 2026 11:05:01 -0700 Subject: [PATCH] test: prevent test_resource_limits_set from hanging in GitHub Actions Set mock_process.pid to None in the resource limits test. Without this, the `finally` block in `run_async` attempts to call `os.killpg` with a fallback `Mock` object (which evaluates to True). In some environments like GitHub Actions, this can inadvertently kill the test runner's process group rather than raising a TypeException, causing the CI job to hang indefinitely. Co-authored-by: Liang Wu PiperOrigin-RevId: 895992429 --- tests/unittests/tools/test_bash_tool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unittests/tools/test_bash_tool.py b/tests/unittests/tools/test_bash_tool.py index f0f4851990..d2e1e9c0e3 100644 --- a/tests/unittests/tools/test_bash_tool.py +++ b/tests/unittests/tools/test_bash_tool.py @@ -252,6 +252,7 @@ async def test_resource_limits_set(self, workspace, tool_context_confirmed): ) tool = bash_tool.ExecuteBashTool(workspace=workspace, policy=policy) mock_process = mock.AsyncMock() + mock_process.pid = None # Ensure finally block doesn't try to kill it mock_process.communicate.return_value = (b"", b"") mock_exec = mock.AsyncMock(return_value=mock_process)