From 54f459d6263c23564466e99a8436af7aeec2059e Mon Sep 17 00:00:00 2001 From: Tejas Kashinath Date: Tue, 5 May 2026 14:59:35 -0400 Subject: [PATCH 1/2] test: trim scheduled e2e matrix and harden dev-server process cleanup Scheduled Monday e2e run now targets 6 priority suites covering CodeZip, Container, custom JWT auth, evals, import, and local dev paths. Manual workflow_dispatch still runs the full e2e directory to exercise every framework/model-provider combo. Halves weekly AWS test burn from 6 shards of the full suite to 6 shards of the priority subset. Replace fire-and-forget SIGTERM in integ-tests/dev-server.test.ts with a process-group-aware terminator that: signals the whole group via -pid, waits on the child's exit event, and SIGKILLs the group after a 5s timeout if the process hangs. Spawn now uses detached:true so the process-group signal actually reaches subprocesses of the dev server. --- .github/workflows/e2e-tests-full.yml | 20 +++++++++++- integ-tests/dev-server.test.ts | 46 +++++++++++++++++++++------- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/.github/workflows/e2e-tests-full.yml b/.github/workflows/e2e-tests-full.yml index b34410e8f..3722a064e 100644 --- a/.github/workflows/e2e-tests-full.yml +++ b/.github/workflows/e2e-tests-full.yml @@ -28,6 +28,17 @@ jobs: matrix: cdk-source: [npm, main] shard: ['1/6', '2/6', '3/6', '4/6', '5/6', '6/6'] + env: + # Scheduled runs cover 6 priority suites spanning CodeZip, Container, Auth, + # Evals, Import, and local Dev paths. Manual workflow_dispatch runs the + # full e2e directory to exercise every framework/model-provider combo. + SCHEDULED_TESTS: >- + e2e-tests/strands-bedrock.test.ts + e2e-tests/container-strands-bedrock.test.ts + e2e-tests/byo-custom-jwt.test.ts + e2e-tests/evals-lifecycle.test.ts + e2e-tests/import-resources.test.ts + e2e-tests/dev-lifecycle.test.ts steps: - uses: actions/checkout@v6 with: @@ -79,7 +90,14 @@ jobs: OPENAI_API_KEY: ${{ env.E2E_OPENAI_API_KEY }} GEMINI_API_KEY: ${{ env.E2E_GEMINI_API_KEY }} CDK_TARBALL: ${{ env.CDK_TARBALL }} - run: npx vitest run --project e2e --shard=${{ matrix.shard }} + run: | + if [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "Scheduled run: executing priority e2e suites" + npx vitest run --project e2e --shard=${{ matrix.shard }} $SCHEDULED_TESTS + else + echo "Manual/push run: executing full e2e suite" + npx vitest run --project e2e --shard=${{ matrix.shard }} + fi browser-tests: runs-on: ubuntu-latest environment: e2e-testing diff --git a/integ-tests/dev-server.test.ts b/integ-tests/dev-server.test.ts index 4b07b7284..8133ae949 100644 --- a/integ-tests/dev-server.test.ts +++ b/integ-tests/dev-server.test.ts @@ -69,18 +69,43 @@ describe('integration: dev server', () => { } }, 120000); - afterEach(() => { - // Kill dev server if running - if (devProcess) { - devProcess.kill('SIGTERM'); - devProcess = null; + async function terminateDevProcess(timeoutMs = 5000): Promise { + if (!devProcess) return; + const proc = devProcess; + devProcess = null; + + if (proc.pid) { + try { + process.kill(-proc.pid, 'SIGTERM'); + } catch { + // Process group already exited + } } + + await new Promise(resolve => { + const timer = setTimeout(() => { + if (proc.pid) { + try { + process.kill(-proc.pid, 'SIGKILL'); + } catch { + // Already dead + } + } + resolve(); + }, timeoutMs); + proc.on('exit', () => { + clearTimeout(timer); + resolve(); + }); + }); + } + + afterEach(async () => { + await terminateDevProcess(); }); afterAll(async () => { - if (devProcess) { - devProcess.kill('SIGKILL'); - } + await terminateDevProcess(); await rm(testDir, { recursive: true, force: true }); }); @@ -95,15 +120,14 @@ describe('integration: dev server', () => { devProcess = spawn('node', [cliPath, 'dev', '--port', String(port), '--logs'], { cwd: projectPath, stdio: 'pipe', + detached: true, env: { ...process.env, INIT_CWD: undefined }, }); const serverReady = await waitForServer(port, 20000); expect(serverReady, 'Dev server should respond to ping within 20s').toBeTruthy(); - // Clean shutdown - devProcess.kill('SIGTERM'); - devProcess = null; + await terminateDevProcess(); }, 30000 ); From 609f73e5caa1c3d160889179de5a307ef4b4ad06 Mon Sep 17 00:00:00 2001 From: Tejas Kashinath Date: Tue, 5 May 2026 15:46:48 -0400 Subject: [PATCH 2/2] style: fix prettier formatting in e2e-tests-full.yml --- .github/workflows/e2e-tests-full.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-tests-full.yml b/.github/workflows/e2e-tests-full.yml index 3722a064e..ad213cf24 100644 --- a/.github/workflows/e2e-tests-full.yml +++ b/.github/workflows/e2e-tests-full.yml @@ -33,12 +33,8 @@ jobs: # Evals, Import, and local Dev paths. Manual workflow_dispatch runs the # full e2e directory to exercise every framework/model-provider combo. SCHEDULED_TESTS: >- - e2e-tests/strands-bedrock.test.ts - e2e-tests/container-strands-bedrock.test.ts - e2e-tests/byo-custom-jwt.test.ts - e2e-tests/evals-lifecycle.test.ts - e2e-tests/import-resources.test.ts - e2e-tests/dev-lifecycle.test.ts + e2e-tests/strands-bedrock.test.ts e2e-tests/container-strands-bedrock.test.ts e2e-tests/byo-custom-jwt.test.ts + e2e-tests/evals-lifecycle.test.ts e2e-tests/import-resources.test.ts e2e-tests/dev-lifecycle.test.ts steps: - uses: actions/checkout@v6 with: