From 48aeca9593ada097bc28467b73c502ddac1e3e80 Mon Sep 17 00:00:00 2001 From: garrytan Date: Wed, 30 Sep 2026 06:07:24 +0000 Subject: [PATCH] test(shard-engine): give non-timeout corpus fixtures CI headroom; keep the POSIX golden off the Windows lane Only the wall-timeout fixture keeps a 3s wall; the rest get 60s so a loaded host cannot turn a pass into a timeout. Base and branch runners still agree on every classification under the new walls. The Windows exclusion entry moves the free runner's ratchet (c) residual cap to 2356 lines. --- scripts/test-free-shards.ts | 4 ++++ test/fixtures/module-size-ratchet.json | 2 +- test/fixtures/shard-equivalence/record.ts | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/test-free-shards.ts b/scripts/test-free-shards.ts index f37989b4e..83911f630 100755 --- a/scripts/test-free-shards.ts +++ b/scripts/test-free-shards.ts @@ -338,6 +338,10 @@ export const KNOWN_WINDOWS_INCOMPATIBLE: Array<{ file: string; reason: string }> file: 'test/cso-witness.test.ts', reason: 'tests the contained repair witness with POSIX private-directory and compiled-helper assumptions; comprehensive execution is unavailable on Windows', }, + { + file: 'test/shard-engine-equivalence.test.ts', + reason: 'its classification golden was recorded from the POSIX runners (process-group wall kill); the win32 engine path is pinned by the mocked-platform case in shard-engine.test.ts', + }, { file: 'test/cso-scanner-cli.test.ts', reason: 'drives the prebuilt POSIX CSO launcher with /usr/bin/git and a POSIX-only PATH; native Windows launcher behavior is covered by the dedicated cso-windows-launcher gate', diff --git a/test/fixtures/module-size-ratchet.json b/test/fixtures/module-size-ratchet.json index 16c0a6d4e..f99b1acdc 100644 --- a/test/fixtures/module-size-ratchet.json +++ b/test/fixtures/module-size-ratchet.json @@ -4,7 +4,7 @@ { "file": "test/helpers/module-size.ts", "movedFrom": "(new: ratchet (c) counter)" } ], "residualFiles": [ - { "file": "scripts/test-free-shards.ts", "maxLines": 2352, "reason": "free lane policy after the shard engine took spawn, sandbox, logs, seeds and flags" }, + { "file": "scripts/test-free-shards.ts", "maxLines": 2356, "reason": "free lane policy after the shard engine took spawn, sandbox, logs, seeds and flags" }, { "file": "scripts/test-paid-shards.ts", "maxLines": 1921, "reason": "paid lane policy after the shard engine took sandbox, logs, seeds, verdicts and flags" } ], "allowlist": [] diff --git a/test/fixtures/shard-equivalence/record.ts b/test/fixtures/shard-equivalence/record.ts index 77e1c8707..5738d1032 100644 --- a/test/fixtures/shard-equivalence/record.ts +++ b/test/fixtures/shard-equivalence/record.ts @@ -17,7 +17,9 @@ export const FIXTURES = [ 'pass', 'fail', 'skip', 'wall-timeout', 'module-load-error', 'zero-executed', 'unhandled-between-tests', ] as const; export const REAL_SHARD = 'test/strict-output.test.ts'; -const WALL_MS = 3_000; +// Only the wall-timeout fixture should ever reach its wall; the others get +// generous headroom so a loaded CI host cannot turn a pass into a timeout. +const wallFor = (name: string) => (name === 'wall-timeout' ? 3_000 : 60_000); const root = path.resolve(process.argv[2] ?? path.join(import.meta.dir, '../../..')); const fixtureDir = import.meta.dir; @@ -28,11 +30,11 @@ const freeExit = (status: string) => (status === 'passed' ? 0 : status === 'time try { const runFree = (file: string, index: number) => free.runFreeShard([file], index + 1, FIXTURES.length, { - rootDir: root, quiet: true, log: () => {}, wallTimeoutMs: WALL_MS, + rootDir: root, quiet: true, log: () => {}, wallTimeoutMs: wallFor(FIXTURES[index]), logFilePath: path.join(scratch, `free-${index}.log`), }); const runPaid = (file: string, index: number) => paid.runPaidShard([file], index + 1, FIXTURES.length, { - rootDir: root, timeoutMs: WALL_MS, jobs: 2, logDir: scratch, log: () => {}, + rootDir: root, timeoutMs: wallFor(FIXTURES[index]), jobs: 2, logDir: scratch, log: () => {}, env: { ...process.env, GSTACK_CLAUDE_CLI_VERSION: 'fixture', EVALS: '', EVALS_TIER: '', EVALS_ALL: '' }, }); const files = FIXTURES.map(name => path.join(fixtureDir, `${name}.fixture.ts`));