Repository navigation
fix: disable picker timeout in tests to prevent macOS CI flakiness - #1694
Merged
Merged
Conversation
The picker's default 500ms data collection timeout can cause stale `·` placeholders to appear in snapshot output when tasks don't complete in time on slow CI runners (macOS). This makes snapshot tests non-deterministic. Disable the timeout via `[switch-picker] timeout-ms = 0` in all picker snapshot tests so all task results arrive before rendering. Co-Authored-By: Claude <[email protected]>
max-sixty
enabled auto-merge (squash)
March 23, 2026 19:31
worktrunk-bot
added a commit
that referenced
this pull request
Mar 30, 2026
…akiness The `test_switch_picker_with_multiple_worktrees` and `test_switch_picker_preview_panel_log` tests fail intermittently on macOS CI with `·` stale placeholders appearing in data columns. The previous fix (#1694) disabled the picker's 500ms collect timeout via config (`timeout-ms = 0`), but it relies on the config file being read correctly by the PTY subprocess. On macOS CI, the config occasionally isn't picked up, reverting to the 500ms default — too short for slow runners. Add `WORKTRUNK_TEST_PICKER_NO_TIMEOUT` env var that bypasses config file loading entirely. Set it in `test_env_vars()` so all PTY-based picker tests benefit. This is the same pattern used by `WORKTRUNK_TEST_SKIP_EXPENSIVE_THRESHOLD` and `WORKTRUNK_TEST_EPOCH`. Co-Authored-By: Claude <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Mar 30, 2026
## Problem Two picker snapshot tests fail intermittently on macOS CI ([failed run](https://github.com/max-sixty/worktrunk/actions/runs/23760785525)): - `test_switch_picker_preview_panel_log` - `test_switch_picker_with_multiple_worktrees` Both show `·` stale placeholders in data columns instead of actual values. The triggering commit (`bacca9fb` — docs-only dead code removal) confirms this is a pre-existing timing flake, not a regression. The previous fix (#1694) disabled the picker's 500ms collect timeout via `[switch-picker] timeout-ms = 0` in the test config file. However, the PTY subprocess occasionally doesn't pick up the config on macOS CI, reverting to the 500ms default — too short for slow runners. ## Solution Add `WORKTRUNK_TEST_PICKER_NO_TIMEOUT` env var that the picker checks directly, bypassing config file loading entirely. Set it in `test_env_vars()` so all PTY-based picker tests benefit automatically. This follows the same pattern as `WORKTRUNK_TEST_SKIP_EXPENSIVE_THRESHOLD` and `WORKTRUNK_TEST_EPOCH`. The existing config-based `disable_picker_timeout()` helper is retained as a belt-and-suspenders approach. ## Testing - All 14 `switch_picker` tests pass locally - `pre-commit run --all-files` passes (clippy, fmt, etc.) --- Automated fix for [failed run](https://github.com/max-sixty/worktrunk/actions/runs/23760785525) --------- Co-authored-by: worktrunk-bot <[email protected]> Co-authored-by: Claude <[email protected]>
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.
Problem
The
test_switch_picker_with_multiple_worktreestest failed on macOS CI (run) with a snapshot mismatch — a·stale placeholder appeared in the Upstream column for themainworktree.The picker has a 500ms default data collection timeout (
[switch-picker] timeout-ms). On slow macOS CI runners, the Upstream task sometimes doesn't complete within this window, causingrender_list_item_stale()to show·instead of an empty cell. The triggering commit (a437238e) was docs-only, confirming this is a pre-existing timing flake.Solution
Disable the picker timeout (
timeout-ms = 0) in all picker snapshot tests viawrite_test_config. This ensures all task results arrive before rendering, making snapshots deterministic regardless of CI runner speed.Added a
disable_picker_timeout()helper that appends the config to the test config file, working correctly both when the file is empty (most tests) and when it already has content (test_switch_picker_respects_list_config).Testing
test_switch_picker_with_multiple_worktreespasses locally🤖 Automated fix for failed run