You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assert on the rendered legacy field instead of a bare "99" so the PR-fix comment test stops failing on the footer timestamp #1257
Assert the legacy totalAttempts field is absent by its rendered form rather than by a bare 99, so src/lib/pr-fix-surfacing.test.ts stops failing whenever the rendered footer timestamp happens to contain the digits 99.
What happens
src/lib/pr-fix-surfacing.test.ts ends the "renders workerExecutions and enqueueRows separately, never as 'attempts' (#1218)" case with:
The body under test ends with a footer rendered from new Date(), e.g.
Posted automatically by Dispatch on 2026-10-14T05:47:20.799Z
The 99 in the millisecond field (.799) satisfies the second assertion, so the test fails whenever the run's wall-clock milliseconds happen to contain two consecutive nines — roughly a few percent of runs, unrelated to any code change. Observed on 2026-10-14 during PR #1247 local validation: one full-suite run failed on this case, and three targeted reruns of the file passed without any change.
Why the bare-digit assertion exists
The field being guarded is the deprecated totalAttempts: 99 passed into buildNeedsHumanComment (src/lib/pr-fix-surfacing.ts). The intent is "the legacy total is never rendered", which the neighbouring not.toContain("Total attempts") already covers at the label level.
Acceptance
The legacy field's absence is asserted against a form that cannot collide with the timestamp — either drop not.toContain("99") now that not.toContain("Total attempts") covers it, or match a rendered fragment the comment would actually contain if the field leaked.
The rendered comment body is passed a fixed/frozen clock in this test so the footer is deterministic regardless.
npx vitest run src/lib/pr-fix-surfacing.test.ts passes on repeated runs across differing millisecond values.
Scope
Test-only, src/lib/pr-fix-surfacing.test.ts (and src/lib/pr-fix-surfacing.ts only if the body needs a seam to freeze the clock).
Found while
Validating PR #1247 (src/lib/pr-fix-surfacing.test.ts is not touched by that PR).
Activity
fix(test): pin PR-fix comment footer clock and drop brittle 99 guard (#…