Repository navigation
Fix: add explicit per-test timeout to real-PowerShell skill-script integration test - #550
Merged
AmaadMartin merged 2 commits intoJul 31, 2026
Conversation
added 2 commits
July 28, 2026 13:55
…tion tests The Windows-gated 'successfully executes a real PowerShell skill script' integration test (and its siblings) flakily failed on the slow windows-latest CI runner with 'Test timed out in 5000ms.' — vitest's default per-test budget. Every test in this file spawns a real child process (node, python, PowerShell, cmd, or sh) via UnsafeLocalCodeExecutor, so all share the same 5000ms-default flakiness risk. Introduce a file-level TEST_EXECUTION_TIMEOUT = 40000 constant (mirroring the established build_setup_test.ts pattern) and pass it as the 3rd argument to every it(...)/it.skipIf(...) in the file. 40s also clears the executor's own 30s internal timeout so its cleaner error surfaces on a genuine hang. Test-only change: no production code, config, or dependency changes.
Review feedback: the reported flake is on windows-latest, but the previous commit added the timeout to all twelve tests in the file. Adding a 3rd argument to the six single-line-header it(...) calls made Prettier explode each call, producing 172 insertions / 137 deletions where only whitespace actually moved. The four it.skipIf(!IS_WINDOWS) tests are already multi-line, so scoping to them is a pure one-line addition each: the net diff against main is now 10 insertions and 0 deletions, with no reformatting and a much smaller conflict surface against other work in flight on this file. Also anchor the timeout invariant to its source so the 30s figure is grep-able rather than prose-only: the comment now names core/src/code_executors/unsafe_local_code_executor.ts.
kalenkevich
approved these changes
Jul 31, 2026
Merged
This was referenced Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
The
validationworkflow'srun-tests (windows-latest)job intermittently failswith
Error: Test timed out in 5000ms.on the integration test'successfully executes a real PowerShell skill script'intests/integration/tools/run_skill_script_tool_test.ts. The test spawns areal PowerShell child process through
UnsafeLocalCodeExecutor; PowerShellcold-start plus script execution on the shared, slow
windows-latestrunnerroutinely exceeds vitest's built-in default
testTimeoutof 5000ms.vitest.config.tssets notestTimeoutfor theintegrationproject, so the5000ms default applies to every
it(...)that does not pass its own budget.Notably, the executor's own internal timeout defaults to 30s (see
timeoutSecondsincore/src/code_executors/unsafe_local_code_executor.ts), sothe code under test is willing to wait far longer than vitest allows — vitest
kills the test at 5s.
Solution:
This is a pure test-infrastructure (flakiness) fix; no production/runtime
behavior changes. Mirroring the established in-repo pattern in
tests/integration/build_setup/build_setup_test.ts, a file-level constantconst TEST_EXECUTION_TIMEOUT = 40000;is introduced and passed as the optional3rd argument to every
it(...)/it.skipIf(...)in the file.Every test in this file spawns a real child process (
node,python,PowerShell,
cmd, orsh), so they all share the same 5000ms-default flakinessclass; applying the constant uniformly is the root-cause fix and keeps the file
consistent.
40000(40s) was chosen because it deliberately exceeds the executor's own 30sinternal timeout, so that on a genuine hang the executor's cleaner
Code execution timed out after N seconds.error surfaces instead of vitest'sgeneric abort. It also matches the sibling constants in
tests/integration/app_loader/app_loader_test.tsandtests/integration/agent_loader/agent_dirname_test.ts, which both use40000.A per-test timeout is an upper bound, not a delay, so fast-completing tests are
unaffected.
No changes were made to
vitest.config.ts,build_setup_test.ts, or anyproduction source under
core/,dev/, orintegrations/. The large line countin the diff is purely Prettier re-wrapping the previously single-line
it('name', async () => {...})calls onto multiple lines once a 3rd argument isadded — the canonical formatting also used by
build_setup_test.ts.Testing Plan
Unit Tests:
This is a test-only change; the modified integration test is the end-to-end
exercise (it runs real skill scripts through
UnsafeLocalCodeExecutorwith nomocks).
Targeted run of the affected file:
On a Linux dev host this reported 8 passed | 4 skipped (12) — the four
Windows-gated PowerShell/CMD tests are correctly
skipped(not failed),confirming the
.skipIf(...)(name, fn, timeout)call shape compiles andtype-checks and that the JS/Python/Shell tests still pass.
Lint and format gates (both enforced by the
validationworkflow) are clean:npm run lintandnpm run format:check.Manual End-to-End (E2E) Tests:
integrationproject'sglobalSetupcanresolve
@google/adk):npm ci && npm run buildnpx vitest run --project integration tests/integration/tools/run_skill_script_tool_test.tsrun-tests (windows-latest)job,where the PowerShell/CMD tests actually execute under the new 40s budget. On
Windows, confirm the PowerShell test passes and completes well under 40s.
Checklist
Additional context
The added constant is documented inline in the test file so future readers
understand why the budget is 40s rather than an arbitrary larger number: it must
clear the executor's own 30s internal timeout for the executor's error message to
win the race on a genuine hang.