Repository navigation
fix(test): drive the triage clock deterministically in the 3A time-boxed cold pass test - #5806
Masashi-Ono0611 wants to merge 1 commit into
Conversation
…xed cold pass test The test assumed 25 PGLite cache lookups take longer than a 1ms budget, so a fast run can finish every lookup inside the budget and defer nothing. Forward the triage helper's existing clock seam through the phase and advance it in the test, and assert that the injected clock was read. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Independent confirmation that this is the fix for a recurring CI failure. The same failure in Tier 1 on unrelated branches (
Local reproduction (macOS, Bun 1.4.2,
The PR still applies on current master. #5797 changed the |
…boxed cold pass test (garrytan#5806) The 3A cold-pass test set a 1 ms triage budget and assumed 25 uncached PGLite lookups would exceed it; on a fast machine every lookup finished inside the budget, nothing deferred and deferred >= 1 failed. The synthesize phase now forwards an optional triageNow seam to the triage helper's existing clock option (production keeps Date.now), and the test advances that clock so it asserts exactly 25 deferred and 0 degraded. Absorbs community PR garrytan#5806. Discrimination test: reverted src/core/cycle/synthesize.ts to master, ran test/e2e/dream-synthesize-pglite.test.ts -> 29 pass / 1 fail. Restored -> 30 pass. Co-Authored-By: Masashi-Ono0611 <98894508+Masashi-Ono0611@users.noreply.github.com>
What
The
3A: a time-boxed cold pass labels deferred files "not yet triaged" in the headlinetest intest/e2e/dream-synthesize-pglite.test.tsno longer depends on how fast PGLite answers 25 cache lookups. The phase forwards the triage helper's existing clock seam, and the test advances that clock.Why
The test set a 1 ms triage budget and assumed 25 uncached PGLite lookups would take longer than that. Triage checks the budget after each cache lookup, so a fast run can finish every lookup inside the budget and mark all 25 files degraded and none deferred. The assertion
deferred >= 1then fails withExpected: >= 1.It failed in Tier 1 on two unrelated PRs while master and other PRs on the same base passed. On one machine, the unchanged master copy of the file failed 5 of 5 runs.
SynthesizePhaseOptsgets an optionaltriageNow, next to the existingnowseam, and it is forwarded to the triage helper asnow. When it is undefined the helper keeps itsDate.nowdefault, so production behavior does not change.Discrimination test (required for every fix — #3665)
Discrimination test: reverted
src/core/cycle/synthesize.tstoupstream/master, rantest/e2e/dream-synthesize-pglite.test.ts→29 pass / 1 fail. Restored → all pass.Verification
No user-facing message or command is added.
Tests
test/e2e/dream-synthesize-pglite.test.ts: 5 consecutive whole-file runs after the change, all exit 0. The unchanged master copy of the file: 5 runs, all exit 1.bun run typecheckexit 0.bun run verify66/66 checks pass.