Skip to content

test(web): the stepped-loops and pinned-header tests wait for frames, not a fixed time - #921

Merged
badcuban merged 1 commit into
mainfrom
fix/flaky-theme-and-stepped-loop-tests
Nov 14, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/flaky-theme-and-stepped-loop-tests

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

The problem

Two browser tests failed once each in CI on changes that did not touch them (#919 and #916), and passed on a re-run. Both give the browser a short, fixed time to draw. A busy CI machine draws a frame or two in half a second, so the time ran out with nothing to check.

  • steppedLoops.browser.tsx watched a loop's positions over a fixed 500 ms and wanted more than two poses: expected 1 to be greater than 2.
  • themeStore.browser.tsx ("keeps a group's pinned header…") waited the default second for a scroll-state container query, which only updates when a frame is drawn: expected 'hidden' to be 'visible'.

The fix

  • Stepped loops: the test reads each drawn frame until the run shows what it is about (three poses, an off-grid pose), capped at 10 s, then asserts on the whole run exactly as before. All three windows in the file use it.
  • Pinned header: its two waits are 10 s.

Only the two test files change.

How sure

  • Stepped loops is shown. With the page's thread held busy 450 ms of every 490 ms, the old test fails with the same kind of message and the new one passes. Under software graphics, 12 tabs at background priority and 54 to 60 busy processes, an old copy failed once in four runs and no new copy failed.
  • Pinned header is inferred. Its failure did not reproduce locally, under load or with the page's thread held busy. If the cause is something else it will fail again, at 10 s.

… not a fixed time

Both tests gave the browser a short, fixed time to draw. A busy CI machine
draws a frame or two in half a second, so they failed with nothing to check.

steppedLoops watched a loop's positions over a fixed 500 ms and wanted more
than two poses ("expected 1 to be greater than 2" on #919). It now watches
each drawn frame until the run shows what the test is about, capped at 10 s,
and asserts on the whole run as before. With the page's thread held busy
450 ms of every 490 ms, the old test fails that way and this one passes.

The pinned-header test waited the default second for a scroll-state query,
which only updates when a frame is drawn (failed once on #916). Its waits are
now 10 s. That failure did not reproduce locally, so this one is inferred.
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 14, 2026 9:14pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 8815ee9 Nov 14, 2026
24 checks passed
@badcuban
badcuban deleted the fix/flaky-theme-and-stepped-loop-tests branch November 14, 2026 21:42

This branch was previously deployed

1 inactive deployment
Preview — cf887a65 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant