test(webviews): base passes the fixed-wait ratchet again

Merged
TE
15d ago
+150-78

Base fails bun run check:fixed-waits (and so every PR into feat-cmux-next): #23094 merged after the guard (#23365) with 9 new fixed waits.

  • test/snapshot-save-throttle.test.ts: the 250 ms snapshot save timer now runs on bun's fake timers. Nothing is written at 249 ms and one write lands at 250 ms. The old sleep(300) passed with any delay under 300 ms; I checked that setting SNAPSHOT_SAVE_MS to 100 now fails it.
  • test/browser/streaming-text.harness.tsx, test/streaming-text-frames.test.ts: the reveal drain and the settle window are sampled for jumps, so the window is the test. The 500 ms before sampling lets start-up work finish so the work budget measures only the stream, and nothing marks start-up as done. All three get // fixed-wait: markers.
  • RevealedMarkdown.test.tsx: the 20 ms in afterEach is teardown with nothing asserted after it. Marked.

Checks: check:fixed-waits passes (992), bun run check, scripts/web-lint.sh, and the two unit files 3 × 3 pass. The browser files only gained comments.

Agent session: huge-blue

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes bun run check:fixed-waits on base so PRs into feat-cmux-next no longer fail from waits merged after the guard in #23094 and #22967, plus follow-up test fixes.

Test changes

  • Switch snapshot-save-throttle.test.ts to bun's fake timers with exact assertions at 249 ms and 250 ms.
  • Run the row-wait tests in agent-pane-reveal-message.test.ts on the fake clock, advancing it instead of sleeping.
  • Replace the poll loops in agent-pane-queued-images.test.ts with waits that resolve on the client's snapshots and time out at 3 s so the failure message isn't swallowed by bun's 5 s test timeout.
  • Mark the reveal drain and settle window waits in streaming-text.harness.tsx and the 500 ms start-up wait in streaming-text-frames.test.ts as fixed waits; these windows are the test.
  • Mark the 20 ms teardown wait in RevealedMarkdown.test.tsx as a fixed wait since nothing asserts after it.

Script changes

  • A baseline row for a deleted file now passes instead of failing every PR, and is dropped on --update-baseline; the comparison logic is extracted as compareToBaseline and covered by a unit test.
  • Drop the stale session-sidebar-preview.test.tsx baseline row so a new file at that path wouldn't inherit its six-wait allowance.