Skip to content

fix: resolve flaky PTY/timing issues in integration tests - #1459

Merged
max-sixty merged 1 commit into
mainfrom
fix/flaky-pty-tests
Mar 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/flaky-pty-tests

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Three root causes of intermittent PTY test failures under CI load:

  1. Timing assertion in test_list_progressive_api — total_duration < 5s fails under load due to the 1s minimum drain wait. Removed (tests correctness, not performance).

  2. Insufficient stabilization timeout in switch_picker tests — skim's async item loading can exceed 10s under heavy CI. Increased to 30s (fast 10ms polling means no slowdown in normal case).

  3. Stability vs content race in wait_for_stable_with_content — required screen_unchanged_500ms AND content_present simultaneously, but skim's cosmetic redraws (cursor positioning, border repaints) kept resetting the stability timer. Added content_found_at fallback: once expected content has been continuously present for 500ms, accept stability regardless of cosmetic redraws. Also panics with diagnostics when expected content never appears (previously warned silently, leading to confusing snapshot mismatches).

Bonus: fixed incorrect expected content "│orphan-branch" → "orphan-branch" in test_switch_picker_respects_list_config (orphan-branch is in the list panel, not adjacent to the border). Previously masked by the silent timeout.

This was written by Claude Code on behalf of max-sixty

Remove timing assertion from test_list_progressive_api, increase switch_picker
stabilization timeouts from 10s to 30s, add content-presence fallback for skim
cosmetic redraws, and fix incorrect expected content in
test_switch_picker_respects_list_config.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 5833954 into main Mar 12, 2026
23 checks passed
@max-sixty
max-sixty deleted the fix/flaky-pty-tests branch March 12, 2026 06:25
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