fix(test-runner): real carve-guard keys in TREE_MUTATING; census pins; size-scaled wall deadlines

TREE_MUTATING listed 'test/carve-guard-checks.test.ts' — a file that
has never existed (the real ratchet readers are
carve-guard-completeness and carve-section-ordering), so the intended
serialization was silently absent. New census pin tests fail on any
key that doesn't name a real free test file, and on a TEST_ROOTS
entry that stops contributing files. Full-suite wall deadlines now
scale with shard size (max(6min, files x 5s)) so a jobs=1 machine or
the ~130-file Windows shards can't false-timeout a healthy run;
explicit --wall-timeout disables scaling. Stale --parallel wording in
the dry-run message, jsdoc, and the TREE_MUTATING ordering comment
corrected to the shipped process-shard model.
This commit is contained in:
Garry Tan
2026-08-15 16:49:39 -07:00
parent 661b3d943f
commit 9e5fbd0a6a
2 changed files with 96 additions and 22 deletions
+41
View File
@@ -15,6 +15,12 @@ import {
FreeRunReporter,
buildRunEpilogue,
FREE_TEST_TIMEOUT_MS,
DEFAULT_WALL_TIMEOUT_MS,
PER_FILE_WALL_MS,
wallTimeoutForShard,
TEST_ROOTS,
TREE_MUTATING,
WORKER_HOSTILE,
} from '../scripts/test-free-shards';
const ROOT = path.resolve(import.meta.dir, '..');
@@ -477,3 +483,38 @@ describe('test-free-shards: output contract (log capture, quiet console, failure
expect(reporter.report().failures[0]).toEqual({ file: 'browse/test/x.test.ts', testName: 'boom' });
});
});
describe('test-free-shards: curated-list census pins', () => {
// A renamed test file must FAIL here, not silently drop its serialization
// (a phantom TREE_MUTATING key means the reader races regenerating shards
// again) or its serial-child quarantine (WORKER_HOSTILE).
test('every TREE_MUTATING and WORKER_HOSTILE key names a real free test file', () => {
const census = new Set(collectFreeTestFiles(ROOT));
const stale = [...Object.keys(TREE_MUTATING), ...Object.keys(WORKER_HOSTILE)]
.filter((key) => !census.has(key));
expect(stale).toEqual([]);
});
test('every TEST_ROOTS entry exists on disk and contributes at least one test file', () => {
const files = collectFreeTestFiles(ROOT);
for (const root of TEST_ROOTS) {
expect(fs.existsSync(path.join(ROOT, root))).toBe(true);
expect(files.some((f) => f.startsWith(`${root}/`))).toBe(true);
}
});
});
describe('test-free-shards: wall-timeout scaling', () => {
test('typical local shard keeps the 6-minute floor', () => {
expect(wallTimeoutForShard(70)).toBe(DEFAULT_WALL_TIMEOUT_MS);
});
test('oversized shards (jobs=1 machines, Windows lane) scale linearly past the floor', () => {
expect(wallTimeoutForShard(130)).toBe(130 * PER_FILE_WALL_MS);
expect(wallTimeoutForShard(420)).toBe(420 * PER_FILE_WALL_MS);
});
test('an explicit base above the scaled value wins', () => {
expect(wallTimeoutForShard(10, 10 * 60_000)).toBe(10 * 60_000);
});
});