Skip to content

test(web): the real chat-list tests wait for the list to settle, not a fixed pause - #735

Merged
badcuban merged 1 commit into
mainfrom
fix/chat-list-test-flakes
Nov 2, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/chat-list-test-flakes

Conversation

@badcuban

@badcuban badcuban commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Three tests in MessagesTimeline.real-list.browser.tsx failed now and then on CI (on main, and in the merge queue for #733 and #734), never on a Mac:

  • "catches up and follows when a hold that began up the thread ends at the bottom": the list was back at the end after scrolling up (expected 0 to be greater than 100);
  • "keeps streamed markdown from bouncing as its blocks arrive": a 4 px drop;
  • "keeps a note in progress, and its highlight, while the list redraws the text": the actions never opened after the selection.

What I tried. I ran diagnostic branches on CI (by workflow_dispatch, no PR) with these tests repeated 10, then 40 times, and then 8 fresh-tab copies of the file. 59 tries each, zero failures, so the cause is unproven. Along the way I ruled out web fonts (the tests don't load them) and the library's DOM re-sort (in this app the rows stay out of order, so it isn't what moves them).

Change. The likely cause is timing at the start of each test:

  • The first two failed right after a fixed 300 ms pause meant to let the list finish its first layout. They now wait (waitForListToSettle) until scroll position and height hold still for 300 ms.
  • The selection tests select text right after the list scrolls, when it may still be rebuilding rows. renderLongChat now also waits (waitForRowsToSettle) until the list stops adding and removing elements for 600 ms.
  • The failure messages of the scroll and note tests now report what the list was doing, so a next failure explains itself.

The real-list file passes locally three times in a row (24/24); fmt, lint and typecheck pass.

…a fixed pause

Three tests on the real chat list failed now and then on CI and never on a
Mac: "catches up and follows when a hold that began up the thread ends at
the bottom" (back at the end after scrolling up), "keeps streamed markdown
from bouncing" (a 4 px drop), and "keeps a note in progress" (the actions
never opened). The first two failed right after a fixed 300 ms pause meant
to let the list finish its first layout; on a busy runner it can still be
working then. The selection tests select text right after the list scrolls,
when it may still be building rows again.

They now wait until the list's scroll position and height hold still, and
the selection tests until the list stops adding and removing elements. The
failures never reproduced in 59 tries each on CI (repeats and fresh tabs),
so this removes the likely cause rather than a proven one; the failure
messages now say what the list was doing, so a next failure explains
itself.
@vercel

vercel Bot commented Nov 2, 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 2, 2026 4:40am UTC

Request Review

@github-actions github-actions Bot added the size:M label Nov 2, 2026
@badcuban
badcuban added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit a6bf5de Nov 2, 2026
22 checks passed
@badcuban
badcuban deleted the fix/chat-list-test-flakes branch November 2, 2026 05:01

This branch was previously deployed

1 inactive deployment
Preview — 63a1e655 Deployed Nov 2, 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