fix(e2e): de-flake pane j/k re-target test (BUG-2279)#1003
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (via instrumentation)
pane-controller.spec.ts:160flaked ~50% at line 188 (openItemParam(page)).not.toBe(refA)). Instrumented logging showed the real mechanism: the test opened a named seeded row and pressedj(down), but the two seeds share a same-secondcreated_at, so their list order is a non-deterministic tie-break (cf. BUG-2270). When the named row landed last,jclamps atMath.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.openItemParamstays put → assertion fails.Not a product bug — the follow logic is correct (I first hypothesized a follow-logic race and a
focusPaneRegionstarve; 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
:160now 10/10 stable in isolation (was ~50-60% flaky-then-pass).pane-controller.spec.ts: 21 passed.Closes BUG-2279.
https://claude.ai/code/session_01EZ6yr6pAUFb1uffan912ra