test(switch_picker): fix Windows prompt-echo-lag flake; forbid retries - #3331
Merged
Conversation
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>
worktrunk-bot
approved these changes
Jun 29, 2026
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.
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_rowflaked on the advisory Windows leg while the requiredtest (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-orphannames 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 nextestretriesand 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.