Skip to content

fix(e2e): de-flake pane j/k re-target test (BUG-2279)#1003

Merged
xarmian merged 1 commit into
mainfrom
fix/bug-2279-pane-follow-race
Jul 22, 2026
Merged

fix(e2e): de-flake pane j/k re-target test (BUG-2279)#1003
xarmian merged 1 commit into
mainfrom
fix/bug-2279-pane-follow-race

Conversation

@xarmian

@xarmian xarmian commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Root cause (via instrumentation)

pane-controller.spec.ts:160 flaked ~50% at line 188 (openItemParam(page)).not.toBe(refA)). Instrumented logging showed the real mechanism: the test opened a named seeded row and pressed j (down), but the two seeds share a same-second created_at, so their list order is a non-deterministic tie-break (cf. BUG-2270). When the named row landed last, j clamps at Math.min(idx+1, len-1) and the cursor doesn't move — the pane-follow then correctly sees the focused row is already the paned item and skips. openItemParam stays put → assertion fails.

Not a product bug — the follow logic is correct (I first hypothesized a follow-logic race and a focusPaneRegion starve; instrumentation ruled both out). The fix is test-only.

Fix

Open the first rendered row instead of a named one, so j (down) always has a row beneath it to re-target to, independent of the seed tie-break order.

Verification

  • :160 now 10/10 stable in isolation (was ~50-60% flaky-then-pass).
  • Full pane-controller.spec.ts: 21 passed.
  • Codex review: CLEAN.

Closes BUG-2279.

https://claude.ai/code/session_01EZ6yr6pAUFb1uffan912ra

…BUG-2279)

pane-controller.spec.ts:160 flaked ~50% (fails once, passes on retry). Root
cause via instrumentation: the test opened a NAMED seeded row and pressed `j`
(down) expecting the pane to re-target to a different item. But the two seeds
share a same-second created_at, so their list order is a non-deterministic
tie-break (BUG-2270) — the named row could land LAST, where `j` clamps at the
final index (Math.min(idx+1, len-1)) and the cursor doesn't move. The
pane-follow then correctly finds the focused row is already the paned item and
skips (no re-target), so `openItemParam` stays put and the assertion fails.

Not a product bug — the follow logic behaves correctly. Fix is test-only: open
the FIRST rendered row instead of a named one, so `j` always has a row beneath
it to move to, regardless of seed tie-break order.

Verified: :160 now 10/10 stable in isolation (was ~50-60% flaky); full
pane-controller.spec.ts 21 passed.

Claude-Session: https://claude.ai/code/session_01EZ6yr6pAUFb1uffan912ra
@xarmian
xarmian merged commit 34233a2 into main Jul 22, 2026
@xarmian
xarmian deleted the fix/bug-2279-pane-follow-race branch July 22, 2026 11:14
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