diff --git a/tests/integration/build_setup/build_setup_test.ts b/tests/integration/build_setup/build_setup_test.ts index 880dee469..6028f707a 100644 --- a/tests/integration/build_setup/build_setup_test.ts +++ b/tests/integration/build_setup/build_setup_test.ts @@ -12,17 +12,10 @@ import {getResponse, sendInput} from '../test_case_utils.js'; const execAsync = promisify(exec); const dirname = process.cwd(); +// Hooks do the install/build; each test only runs a short command inside the +// installed fixture. Per-test budget, not an install budget. const TEST_EXECUTION_TIMEOUT = 20000; -// These hooks run `npm install` (plus `npm run build` for ts_* setups) and the -// recursive node_modules teardown, overrunning vitest's default 10s hookTimeout -// and causing flaky "Hook timed out in 10000ms" failures. All twelve hook runs -// take ~16s combined on ubuntu-latest, but a cold, network-bound install has -// been measured at ~70s, so 120s covers the worst case. Don't raise -// TEST_EXECUTION_TIMEOUT for hook flakes; that stays the 20s per-test budget. -// Trade-off: a stuck hook now takes this long to surface. -const HOOK_TIMEOUT = 120000; - describe('Build setup', () => { describe.each([ 'js_commonjs', @@ -52,7 +45,7 @@ describe('Build setup', () => { expect(buildResult.stderr).toBe(''); expect(buildResult.stdout).toContain('\nBuild complete'); } - }, HOOK_TIMEOUT); + }); it( 'should build and run agent successfully', @@ -128,6 +121,6 @@ describe('Build setup', () => { .rm(`${projectPath}/dist`, {recursive: true, force: true}) .catch(() => {}); } - }, HOOK_TIMEOUT); + }); }); }); diff --git a/tests/integration/tools/run_skill_script_tool_test.ts b/tests/integration/tools/run_skill_script_tool_test.ts index aa7f0ef6d..c842bc111 100644 --- a/tests/integration/tools/run_skill_script_tool_test.ts +++ b/tests/integration/tools/run_skill_script_tool_test.ts @@ -21,10 +21,11 @@ import {describe, expect, it} from 'vitest'; const IS_WINDOWS = os.platform() === 'win32'; const IS_UNIX = os.platform() === 'linux' || os.platform() === 'darwin'; -// PowerShell/cmd cold-start on the windows-latest CI runner can exceed vitest's -// 5000ms default. Must also exceed UnsafeLocalCodeExecutor's default +// 40000 tightens the project's 60000 testTimeout, which a per-test argument +// replaces rather than raises. It stays above UnsafeLocalCodeExecutor's default // timeoutSeconds (30) so the executor's own timeout error surfaces first; see -// core/src/code_executors/unsafe_local_code_executor.ts +// core/src/code_executors/unsafe_local_code_executor.ts. Only the four +// it.skipIf(!IS_WINDOWS) tests pass it, where shell cold-start is slowest. const TEST_EXECUTION_TIMEOUT = 40000; describe('RunSkillScriptTool Integration with UnsafeLocalCodeExecutor', () => { diff --git a/vitest.config.ts b/vitest.config.ts index 1b7eaee63..ce7d5124c 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,9 +8,11 @@ import path from 'path'; import {defineConfig} from 'vitest/config'; /** - * Hook budget (ms) for the `integration` project: install-heavy `beforeAll` - * hooks run `npm install` (and sometimes `npm run build`) per fixture, which - * exceeds Vitest's 10s default on a slow or loaded machine. + * Hook budget (ms) for the `integration` project. The `beforeAll` hooks run + * `npm install` (and sometimes `npm run build`) per fixture, and the `afterAll` + * hooks remove `node_modules` recursively, which exceeds Vitest's 10s default. + * A cold, network-bound install has been measured at ~70s, so 120s covers the + * worst case. Trade-off: a stuck hook takes this long to surface. */ const INTEGRATION_HOOK_TIMEOUT_MS = 120000;