Repository navigation
flaky(e2e): prompt-rail:370 re-reads the rail after the poll that settled it #4675
Description
What happened
The Desktop E2E test manual transcript scrolling keeps exactly the visible prompt current (apps/desktop/e2e/prompt-rail.spec.ts:370) fails intermittently on CI, at the first expectPromptRailMatchesReadingPosition(page) call, before the scroll it is about has happened.
The helper (prompt-rail.spec.ts:191-207) polls until one current tick maps from the Turn being read, then takes a fresh snapshot and asserts it again without polling:
await expect.poll(async () => {
lastSnapshot = await activePromptRailSnapshot(page);
return lastSnapshot.expectedId !== null
&& lastSnapshot.currentIds.length === 1
&& lastSnapshot.currentIds[0] === lastSnapshot.expectedId;
}).toBe(true);
const snapshot = await activePromptRailSnapshot(page);
expect(snapshot.expectedId).not.toBeNull();
expect(snapshot.currentIds).toEqual([snapshot.expectedId]); // <- fails hereObserved on CI:
Error: expect(received).toEqual(expected) // deep equality
Array [
- "turn-prompt-rail-119",
+ "turn-prompt-rail-120",
]
at apps/desktop/e2e/prompt-rail.spec.ts:206
The poll passes on a frame where the rail and the reading position agree, and the second snapshot, taken a round trip later, sees the rail one tick further along because the transcript is still settling after scrollTranscriptTo(page, 'bottom'). The second read cannot fail on a settled page, so it only adds a way to fail on an unsettled one. Either the poll's own snapshot should be the one asserted, or the poll should require two consecutive identical snapshots.
How to reproduce
Intermittent; only seen under CI load (Desktop E2E, 4 workers on Xvfb).
- Push any branch and let the
Desktop e2ejob run. - Seen on
mainat 486e9ba (run 33782799008) and afe06f2 (run 33735706980), and on PR feat(website): publish the podling site from website/ #4660 at a917af4 (run 33784567871, attempt 1); the diff above is from the PR run.
The test and the helper were both added in #4417 (merged 2026-09-03 08:44 UTC, closing #4415). The first failure is the main run started eight minutes later (afe06f2, 08:52), so this has flaked since it landed: it is in 2 of the 9 red main CI runs among the last 60, plus one PR run, all within nine hours of merging. #4415 is closed and nothing tracks the test itself. #3863 and #4577 settled other timing in this spec; this read is not covered by either.
Environment
- Maka commit:
mainat 486e9ba, also PR feat(website): publish the podling site from website/ #4660 at a917af4 - OS and version: CI runner, Linux + Xvfb
- Surface: Desktop
Activity
Adarsh-Me commentedon Sep 3, 2026
/assign me
Astro-Han commentedon Sep 3, 2026
you can use
takecommand!Adarsh-Me commentedon Sep 3, 2026
/take
Astro-Han commentedon Sep 3, 2026
I've assigned mannually, a vanilla
takecommand would do the trick, no slash is needed~test(desktop): settle the prompt rail across two consecutive reads (a…
test(desktop): settle the prompt rail across painted frames (apache#4675
test(desktop): settle the prompt rail across painted frames (apache#4675
test(desktop): settle the prompt rail across painted frames (apache#4675
test(desktop): gate the prompt rail on painted-frame quiescence (apac…
test(desktop): pass the rail settle loop as a function, not source (a…
test(desktop): remove the layout-tier E2E specs that block main (#4741)
Astro-Han commentedon Sep 4, 2026
Closing: the test this reports no longer exists.
#4741 removed
prompt-rail.spec.tsin full — 22 tests across it andtranscript-scroll.spec.ts, which together held four of the five open flake reports. They assert scroll geometry against a compositor that settles on its own schedule: that needs a real layout engine, not Electron, and under four-worker Xvfb load the suite read a scroller mid-settle and blocked changes that never touched scrolling.Coverage was deleted, not moved. The rebuild belongs one tier down — Storybook + Chromium for geometry — and is being worked out in #4727.
retries: 0is unchanged.Reopening is the right call if the rebuild lands somewhere this report still applies to.