fix(#478): delete wall-clock elapsed-time assertions per ADR 456 (keep correctness invariants) (#480)

Co-authored-by: CI Rebase Check <ci@gsd-redux>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-29 17:12:41 -04:00
committed by GitHub
parent d2ff4ac092
commit 5f18379da5
4 changed files with 2 additions and 20 deletions

View File

@@ -301,7 +301,6 @@ test('T5: unreclaimable same-PID lock throws bounded error (reclaim-unlink failu
return originalUnlinkSync.call(fs, targetPath);
});
const startMs = Date.now();
assert.throws(
() => runInstallerMigrations({
configDir,
@@ -314,10 +313,4 @@ test('T5: unreclaimable same-PID lock throws bounded error (reclaim-unlink failu
},
'must throw "installer migration lock is held" when reclaim-unlink fails — not spin indefinitely'
);
const elapsedMs = Date.now() - startMs;
// Must resolve within a generous but finite window (fix + timeout overhead).
// If it spins (deadlock regression), the process-level test timeout fires instead.
t.diagnostic(`T5 elapsed: ${elapsedMs}ms (expected ≤500ms for lockTimeoutMs:200 + overhead)`);
assert.ok(elapsedMs < 500, `T5 must resolve within 500ms; actual ${elapsedMs}ms — possible spin-loop regression`);
});

View File

@@ -114,14 +114,9 @@ describe('feat-3594: frontmatter parser handles null bytes without truncation',
});
describe('feat-3594: frontmatter parser handles bounded-large inputs in reasonable time', () => {
test('64KB frontmatter with 2000 array items parses under 2 seconds and returns the right shape', () => {
test('64KB frontmatter with 2000 array items parses and returns the right shape', () => {
const content = loadFixture('huge-bounded.md');
const startedAt = Date.now();
const fm = extractFrontmatter(content);
const elapsedMs = Date.now() - startedAt;
// Time bound is generous — a parser regression that makes this O(n^2)
// would blow well past 2s on this fixture.
assert.ok(elapsedMs < 2000, `parse took ${elapsedMs}ms — should be < 2000ms`);
assert.equal(fm.phase, '06');
assert.ok(Array.isArray(fm.plans), 'plans must be parsed as an array');
assert.equal(fm.plans.length, 2000, 'all 2000 array items must be captured');

View File

@@ -374,13 +374,9 @@ describe('stateReplaceFieldWithFallback field-miss warning', () => {
}
}
const { performance } = require('perf_hooks');
const start = performance.now();
const result = runGsdTools('validate health', tmpDir);
const elapsed = performance.now() - start;
assert.ok(result.success, `validate health should succeed: ${result.error}`);
assert.ok(elapsed < 3000, `Should complete in under 3000ms, took ${elapsed.toFixed(0)}ms`);
const output = JSON.parse(result.output);
assert.ok(typeof output.status === 'string', 'Should return a status string');

View File

@@ -104,11 +104,9 @@ describe('gsd-read-injection-scanner: advisory output', () => {
assert.ok(out.hookSpecificOutput.additionalContext.includes('/home/user/project/README.md'));
});
test('SCAN-07: hook completes within 5s on large content', () => {
test('SCAN-07: hook exits cleanly on large content', () => {
const bigContent = 'x'.repeat(500_000); // 500KB of benign content
const start = Date.now();
const r = runHook(readPayload('/tmp/large.ts', bigContent), 6000);
assert.ok(Date.now() - start < 5000, 'hook should complete within 5s');
assert.equal(r.exitCode, 0);
assert.equal(r.stdout, '');
});