test(screenshot): bump timeout 5s β 30s on captureScreenshot error test (#4736)#4744
Merged
Merged
Conversation
β¦st (#4736) The 'should throw when capture fails (playwright missing or browser unavailable)' test in src/__tests__/screenshot.test.ts flakes 1-in-3 under test:serial system load. 1.13s in isolation, but the test's outer 5s default timeout is tighter than the inner src/screenshot.ts page.goto timeout (30s) β under load, the launch can exceed 5s and vitest aborts as a timeout, not as a real throw. Bumping the per-test timeout to 30s matches the inner constraint and absorbs the system-load case without changing semantics. The try/catch still accepts both throw and succeed. Refs: #4736 (P2 flake investigation, root test infra β Hephaestus)
3 tasks
Contributor
There was a problem hiding this comment.
LGTM β clean test-infra fix for #4736.
Diff: +4/-1, 1 file (src/__tests__/screenshot.test.ts:18). The change adds { timeout: 30_000 } to the one test in the captureScreenshot β error handling describe block, with an inline comment that correctly references the inner page.goto constraint at src/screenshot.ts:62 (verified: timeout: 30_000).
9-gate sweep:
- Review: full diff read, surgical, no scope creep β β
- No conflicts:
mergeable: MERGEABLE, branch up-to-date with develop β β - CI green: 15/15 SUCCESS, 2 expected SKIPPED (test-matrix, auto-label-test) β β
- No regressions:
npm run gate444/444 files, 6285/6285 tests, 0 failed; other 7 tests in the file are sync type/shape tests with no I/O, untouched and unaffected β β - Unit tests: this IS a unit test fix β the 30s budget now matches the inner
page.gotoconstraint, fixing the 5s-vs-30s mismatch root cause β β - E2E/UAT:
npm run gateis the canonical functional verification for test-infra changes; targeted re-run 3x in 1.6-1.7s each β β - Documented: inline comment + PR body + issue #4736 body all align on the Option A rationale; tradeoff analysis against Option B (mock) and Option C (skip) is explicit β β
- Security clean: no source code change, no API change, no secrets, no gitignored files β β
- Targets
develop:baseRefName: developβ β
Acceptance criteria from #4736:
- Screenshot test runs reliably under
npm run gate(full gate pass with 0 fails; targeted re-run 3/3 clean) - Test still validates the documented behavior (error-handling path β try/catch on the import + call)
- PR opened with the fix, references #4736
Lane: test infra (root src/__tests__/) β Hephaestus territory per the 2026-06-16 confirmation. No routing issues.
Approving. Squash-merging to develop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
1-line test infra fix for #4736 (P2 flake). The 'should throw when capture fails' test in
src/__tests__/screenshot.test.tswas tightening the 5s vitest default against a function whose internalpage.gotoalready uses 30s β undertest:serialsystem load, the launch can exceed 5s and vitest aborts as a timeout instead of a real throw. Bumping the per-test timeout to 30s matches the inner constraint.Acceptance criteria
npm run gatepasses (444/444 test files, 6285/6285 tests, 0 failed, 10 pre-existing skipped)src/__tests__/screenshot.test.tsruns 8/8 in 1.69s in isolation with the new timeoutTests added
None. This IS a test β the fix is a 1-line timeout bump on an existing test that was timing out under load.
Commands run
Manual QA
Residual risk
Low. The change adds 25s of headroom to a single test's vitest timeout. Worst case: if a future regression causes the test to actually hang (e.g., playwright install corrupted, browser binary missing), CI sees a 30s hang instead of 5s β a real cost on test:serial (~0.005% of total runtime). Mitigation: the inner
page.gotoalready enforces a 30s bound, so the test cannot hang longer than that. Acceptable tradeoff for flake immunity.Out of scope
Lane
Hephaestus (test infra β root
src/__tests__/files are explicitly in my territory per Daedalus's 2026-06-16 lane confirmation in #aegis-devs).