Skip to content

test(scroll): de-flake invariant-1 by measuring anchor drift from the DOM#968

Open
mremond wants to merge 2 commits into
mainfrom
mr/scroll-invariant1-dom-deflake
Open

test(scroll): de-flake invariant-1 by measuring anchor drift from the DOM#968
mremond wants to merge 2 commits into
mainfrom
mr/scroll-invariant1-dom-deflake

Conversation

@mremond

@mremond mremond commented Jul 10, 2026

Copy link
Copy Markdown
Member

Follow-up to #966. That PR reduced but didn't eliminate the retry-absorbed webkit flake in scroll invariant-1.

Root cause: Assertion B derived drift from __fluuxGetVirtOffset. During the prepend re-assert loop that offset map can report a stale pre-prepend value for a sustained window while scrollTop already reflects the added batch, producing a ~2880–3034px phantom drift that isn't visible on screen. A second trigger was the demo mount blowing the 60s per-test budget on a slow webkit runner.

  • Measure the anchor row's own getBoundingClientRect().top vs its captured before-position — the layout truth the user actually sees, which can't go stale like the offset map. waitForAnchorSettled polls that DOM offset until quiet.
  • Raise the per-test timeout to 120s so slow webkit demo-boot proceeds instead of failing the mount wait.
  • Drop the now-unused virtualizer-offset path; keep the engine-specific tolerance (chromium 20px, webkit 48px).

Verified locally: full scroll suite 48 passed (chromium + webkit), invariant-1 green across repeats.

mremond added 2 commits July 10, 2026 16:30
…virt map

Retry-absorbed webkit flake persisted because Assertion B derived drift from
__fluuxGetVirtOffset: during the re-assert loop that map can report a stale
pre-prepend offset for a sustained window while scrollTop already reflects the
added batch, yielding a ~2880-3034px phantom drift that isn't on screen. A
second trigger was the demo mount blowing the 60s per-test budget on a slow
webkit runner.

- Measure the anchor row's own getBoundingClientRect().top vs its captured
  before-position — the layout truth the user sees, which can't go stale like
  the offset map. waitForAnchorSettled polls that DOM offset until quiet.
- Raise the per-test timeout to 120s so slow webkit demo-boot proceeds instead
  of failing the mount wait (retry no longer needed for that path).
- Drop the now-unused virt-offset path; keep the engine-specific tolerance.

Full scroll suite 48 passed locally (chromium + webkit); invariant-1 12/12
across repeats.
The DOM-based drift measurement fixed the anchor-drift flake, but invariant-1
still retry-flaked on one run purely at the demo mount: waitForSelector hit its
own 45s ceiling when a loaded webkit runner took >45s to boot the bundle + run
the stress seeding. The per-test budget is 120s, so lift the mount wait to 90s
(leaving ~30s for the body) — a slow boot now proceeds instead of burning a
retry. Pure boot-time headroom; no scroll-logic change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant