diff --git a/tests/integration/app_loader/app_loader_test.ts b/tests/integration/app_loader/app_loader_test.ts index 4367307b8..a6fb4332c 100644 --- a/tests/integration/app_loader/app_loader_test.ts +++ b/tests/integration/app_loader/app_loader_test.ts @@ -16,6 +16,10 @@ import {sendInput} from '../test_case_utils.js'; const execAsync = promisify(exec); const dirname = process.cwd(); const TEST_EXECUTION_TIMEOUT = 40000; +// Fixture hooks shell out to `npm install` and recursively delete node_modules. +// That install/IO-bound work is far slower on a cold macOS CI runner than the +// assertions it sets up, so it gets its own ceiling. +const FIXTURE_SETUP_TIMEOUT = 180000; describe('App loader CLI integration', () => { describe.each(['app_ts', 'app_js', 'app_default'])( @@ -29,7 +33,7 @@ describe('App loader CLI integration', () => { beforeAll(async () => { await execAsync('npm install', {cwd: projectPath}); - }, TEST_EXECUTION_TIMEOUT); + }, FIXTURE_SETUP_TIMEOUT); it( 'should run app via package.json start script and get responses', @@ -62,7 +66,7 @@ describe('App loader CLI integration', () => { await fs .unlink(path.join(projectPath, 'package-lock.json')) .catch(() => {}); - }, TEST_EXECUTION_TIMEOUT); + }, FIXTURE_SETUP_TIMEOUT); }, ); }); @@ -77,7 +81,10 @@ describe('AgentLoader discovery and loading integration', () => { beforeAll(async () => { await execAsync('npm install', {cwd: projectPath}); loader = new AgentLoader(projectPath); - }, TEST_EXECUTION_TIMEOUT); + // Discovery is lazy; warm it here so the one-time bundling cost is charged + // to setup rather than to whichever test runs first. + await loader.preloadAgents(); + }, FIXTURE_SETUP_TIMEOUT); it( 'should discover apps vs agents across directories and standalone files', @@ -138,5 +145,5 @@ describe('AgentLoader discovery and loading integration', () => { await fs .unlink(path.join(projectPath, 'package-lock.json')) .catch(() => {}); - }, TEST_EXECUTION_TIMEOUT); + }, FIXTURE_SETUP_TIMEOUT); });