Repository navigation
test(switch): assert alt-l/alt-h no-op via before/after equality - #3245
Conversation
Replace the committed full-list snapshot for test_switch_picker_alt_l_does_not_hscroll with a before/after equality invariant: capture the settled list, press alt-l/alt-l/alt-h, capture again, and require the two byte-for-byte equal. The belief is narrow — "alt-l/alt-h change nothing" — so asserting it directly drops the snapshot's coupling to picker column layout and to async-column render timing. That coupling is what broke #3227: the frozen frame captured a different async state (a populated Age/[TIME] column) than its sibling multiple-worktrees snapshot, so a column change silently diverged them. Dedupe the PTY plumbing the rewrite would otherwise have triplicated: boot_picker_pty (spawn + skim-ready + initial stabilize) and abort_and_exit_code (Escape + discard-drain + exit poll), plus a list_pane_text helper shared with panels(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve the alt-l snapshot delete/modify conflict by keeping it deleted: the test no longer snapshots a frozen frame (it asserts a before/after equality invariant), so #3236's column-layout regen of that snapshot is moot — the exact coupling the rewrite removes. Integrate the rewritten picker helpers with #3238's deflake work: exec_in_pty_capture_noop_probe now sends inputs through the merged-in send_input_awaiting_content path, alongside boot_picker_pty and abort_and_exit_code. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Approved. The All 26 failures are EvidenceWindows run 28190121758, job Both |
boot_picker_pty took the writer/reader from the PTY pair's MasterPty and
then dropped the master on return, threading out only child/writer/rx/
parser. On Unix take_writer() hands back an independent fd so this is
harmless, but on Windows dropping the MasterPty tears down the ConPTY —
so every subsequent write to the picker failed with BrokenPipe ("The
pipe is being closed"), failing all 26 switch_picker tests on the Windows
runner while Linux/macOS stayed green.
Return the master in a PickerSession struct and have each helper hold it
(`_master`) for the session's lifetime, restoring the lifetime the
pre-extraction inline helpers had (where `pair` lived for the whole fn).
The struct also clears clippy's type_complexity on the former 5-tuple.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The required The two red jobs — Approval left in place; I've re-run the two failed jobs. EvidenceBoth failures, identical signature:
This is the same class of PTY/preview timing flake #3242 is de-flaking; this commit doesn't touch the comments-tab preview path. |
Rewrites
test_switch_picker_alt_l_does_not_hscrollfrom a committed full-list snapshot to a before/after equality invariant, and dedupes the PTY test-helper boilerplate the rewrite touched.The problem
The alt-l test asserted a one-bit belief — "alt-l/alt-h don't horizontally scroll the picker list" — by committing the entire rendered list as a snapshot (
switch_picker_alt_l_ignored_list.snap). That over-coupled it to two things it doesn't care about:Age/[TIME]column) that its siblingmultiple_worktreessnapshot didn't, so the two "same frame" snapshots silently diverged. That's what broke test(switch): regen alt-l picker snapshot for the new Remote⇅ column #3227 — and feat(list): show the main…± column by default; --full gates only off-machine columns #3236 (new defaultmain…±column) is the same pattern landing again, editing this very snapshot.The change
Assert the invariant directly: capture the settled list, press alt-l/alt-l/alt-h, capture again, and require the two byte-for-byte equal. No committed frame, so column-layout changes never touch this test and there's no frozen baseline to diverge from a sibling on async timing. The snapshot is deleted.
The rewrite would have triplicated the PTY boot boilerplate, so it's extracted instead, shared across the picker PTY helpers:
boot_picker_pty— spawn + skim-ready + initial stabilize.abort_and_exit_code— Escape + discard-drain + exit poll (the two capture-then-abort helpers).list_pane_text— list-pane extraction, shared withpanels().Testing
The equality assertion was teeth-checked: injecting a Down-arrow (which moves the
>cursor inside the list pane) makes it fail, so it catches a real list change. The full suite is green, and the new test passes under #3236's newmain…±column layout — confirming it's immune to the exact coupling it removes.