Skip to content

test(switch_picker): fix Windows prompt-echo-lag flake; forbid retries - #3331

Merged
max-sixty merged 1 commit into
mainfrom
windows-flakes
Jun 29, 2026
Merged

test(switch_picker): fix Windows prompt-echo-lag flake; forbid retries#3331
max-sixty merged 1 commit into
mainfrom
windows-flakes

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Removes a Windows-only false-positive on the advisory affected tests (windows) leg so it can eventually be promoted to a required gate.

test_switch_picker_alt_x_keeps_unmerged_branch_row flaked on the advisory Windows leg while the required test (windows) leg passed on the same SHA. From the captured CI frame, the panic was the content assertion, not the exit code: the old assertion counted the branch name across skim's query-echo prompt line plus the data row (>= 2), and under Windows CI load the prompt echo trails its keystrokes — the final character can still be unrendered once the row is already on screen — collapsing the count to 1.

The fix gates on the gutter-prefixed cursor row. A local branch with no worktree renders the / gutter (BranchScope::Local), so / unmerged-orphan names the data row and excludes skim's gutterless prompt, and it renders from collect data so it's immune to echo lag. This is the same robust idiom the sibling alt-x tests already use.

Also adds a "No Retries" section to tests/CLAUDE.md: worktrunk sets no nextest retries and writes no retry loops, with the two root-fix paths (racy assertion → make it deterministic; resource pressure → bound concurrency).

This does not touch the separate, lower-rate STATUS_DLL_INIT_FAILED (-1073741502) flake, which is Windows process-spawn resource exhaustion under concurrent load rather than a test-logic bug. The "No Retries" section documents the deterministic lever (bounding Windows test concurrency) for whenever the advisory leg is promoted.

The picker fix targets Windows-specific timing and passes on macOS, but the flake itself can only be confirmed gone on the Windows CI legs.

This was written by Claude Code on behalf of max

test_switch_picker_alt_x_keeps_unmerged_branch_row counted the branch
name across skim's query-echo prompt line plus the data row (>= 2).
Under Windows CI load the prompt echo trails its keystrokes, dropping
the final character and collapsing the count to 1, so the test flaked on
the advisory Windows leg while the required leg passed on the same SHA.

Gate on the gutter-prefixed cursor row instead: a local branch with no
worktree renders the `/` gutter (BranchScope::Local), so `/ unmerged-orphan`
names the data row and excludes skim's gutterless prompt, and it renders
from collect data so it's immune to echo lag. This mirrors the robust
sibling alt-x tests.

Add a "No Retries" section to tests/CLAUDE.md: worktrunk sets no nextest
retries and writes no retry loops; a test that passes only on retry is a
bug report, and retrying discards it. Fix flakes at the root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@max-sixty
max-sixty merged commit 603efc9 into main Jun 29, 2026
37 checks passed
@max-sixty
max-sixty deleted the windows-flakes branch June 29, 2026 21:13
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.

2 participants