Skip to content

Commit 2edc527

Browse files
author
npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6
committed
test(harness): make ancestor-island trigger state-tolerant for the RED→GREEN flip
The spec's island-root precondition was a hard 30s `expect(...).toBeVisible()`. That only holds on the diseased client: main's useLoadMissingAncestors fetches the old root by id and merges it into the timeline, so "island root" appears — the injected island is what strands the pager. The overhaul DELETES useLoadMissingAncestors (the relay-owned window cursor can't be moved by an out-of-band merge), so the island is never injected and that row never appears. The hard wait made the spec fail at the precondition on the cured client, before it could reach the reachability invariant that actually flips. Relax the precondition to a best-effort `waitFor(...).catch()`: on main it settles the poison before scrollback; on the overhaul it times out harmlessly and we proceed. The gap-reachability assertion is unchanged — it is the invariant that flips 0/100 (stranded) → 100/100 (reachable), and it is what keeps the RED honest: the diseased client still establishes the poison and strands all 100 rows. Verified both states, same fixture, live relay + real UI: - main (useLoadMissingAncestors present): RED, seen.size = 0/100, ~46s scroll. - integrated window read-model tree: GREEN, seen.size = 100/100, 0 missing. Co-authored-by: npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6 <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Tyler Longwell <[email protected]>
1 parent 036f2ee commit 2edc527

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

‎desktop/tests/e2e/parity-ancestor-island.spec.ts‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,22 @@ test("live relay: an ancestor island does not strand the history frontier", asyn
7373
const timeline = page.getByTestId("message-timeline");
7474
await expect(timeline.locator("[data-message-id]").first()).toBeVisible();
7575

76-
// The trigger: wait for useLoadMissingAncestors to fetch the old island root
77-
// and merge it into the channel cache. Once "island root" is in the DOM the
78-
// cache is poisoned — this is the state that strands the pager on main.
79-
await expect(
80-
timeline.getByText(`island root ${nonce}`, { exact: false }).first(),
81-
).toBeVisible({ timeout: 30_000 });
76+
// Establish the poison precondition on the diseased client: on main,
77+
// useLoadMissingAncestors fetches the old root by id and merges it into the
78+
// channel cache, and "island root" appears in the timeline — that injected
79+
// island is what strands the pager. The overhaul DELETES useLoadMissingAncestors
80+
// (the relay-owned window cursor can't be moved by an out-of-band merge), so
81+
// the island is never injected and this row never appears. Best-effort, not a
82+
// hard gate: on main it settles the poison before we scroll; on the overhaul
83+
// it just times out harmlessly and we proceed to the reachability invariant —
84+
// which is the assertion that actually flips 0/100 (stranded) → 100/100.
85+
await timeline
86+
.getByText(`island root ${nonce}`, { exact: false })
87+
.first()
88+
.waitFor({ state: "visible", timeout: 15_000 })
89+
.catch(() => {
90+
/* cured client: no ancestor fetch, no island — expected on the overhaul */
91+
});
8292

8393
// Union of THIS run's `gap` contents ever rendered. Virtualization only
8494
// mounts a window, so accumulate across scroll passes rather than snapshot

0 commit comments

Comments
 (0)