Skip to content

fix(test): the nested CSS watch test tolerates a save that rebuilds twice - #496

Merged
allisonmahmood merged 1 commit into
mainfrom
t3code/implement-issue-487
Oct 3, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
t3code/implement-issue-487

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

What changed

The nested CSS watch test in pageImports.test.ts flaked on CI (test (22) on #485). It read one watcher result per file write. A plain write truncates and then writes, which can trigger two rebuilds, so a stale duplicate refusal could stand in for the fixed build.

The test now saves by renaming a complete file into place, and its next() skips a result identical to the one it last returned. These are the mitigations the dev server's watch test already uses (save and inspectedChanges in devServerWatch.test.ts). Assertions stay outside the wait, so a new error or unexpected CSS still fails. No production code changes; triage found no production defect.

Closes #487

How it was verified

  • pnpm test passes locally

  • Added or updated tests covering this change

  • Temporary checks (not shipped): pushing a duplicate refusal into the queue before and after the fix write fails the old test, and the new test reaches the blue build. The new test still fails on a differing refusal after the fix, or on a fix that writes green instead of blue.

  • isDeepStrictEqual treats two LocalError refusals with the same code and message as equal, and different ones as unequal, on Node 22.22.0 and 24.20.0.

  • Looped 50 times each on Node 22.22.0 and 24.20.0, run concurrently: 100/100 passed.

  • pnpm verify: format, lint, typecheck, test (1625/1625), postgres-concurrency, cli-smoke, tier2-smoke and browser pass.

  • After rebasing onto b320800 (fix(analytics): a nested invocation's db_ms no longer exceeds its parent's #497), which adds an unrelated it.each build test to the same file: looped 25 times each on Node 22.22.0 and 24.20.0, 50/50 passed; format, lint and test typecheck pass.

Release impact

  • Breaking
  • Not breaking: test only.

Review

  • GPT 6.1 Sol (codex): no findings.
  • /code-review standards and spec passes: no hard findings. The file's node-builtin waiver reason now covers the deep comparison.

Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex.

@github-actions github-actions Bot added area:cli Touches the cli area size:s Under 100 changed lines labels Oct 2, 2026
…wice

A plain write truncates the file and then writes it, which can fire two
watch events. The test took one queued result per write, so a second
identical refusal could stand in for the fixed build and fail on CI.

Saves are now renamed into place, and `next()` skips a result identical
to the one it last returned, mirroring the dev server's watch test.

Closes #487

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the t3code/implement-issue-487 branch from 7d67712 to 88101a5 Compare October 3, 2026 19:37
@allisonmahmood
allisonmahmood merged commit 0572fba into main Oct 3, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the t3code/implement-issue-487 branch October 3, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Touches the cli area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky: pageImports nested CSS recovery test reads a stale watch result

1 participant