Skip to content

fix: disable picker timeout in tests to prevent macOS CI flakiness - #1694

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-23455369236
Mar 23, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/ci-23455369236

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Problem

The test_switch_picker_with_multiple_worktrees test failed on macOS CI (run) with a snapshot mismatch — a · stale placeholder appeared in the Upstream column for the main worktree.

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, causing render_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 via write_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_worktrees passes locally
  • Fix applied to all 8 picker tests that use snapshot assertions

🤖 Automated fix for failed run

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]>
@worktrunk-bot worktrunk-bot added the automated-fix Automated CI fix label Mar 23, 2026
@max-sixty
max-sixty enabled auto-merge (squash) March 23, 2026 19:31
@max-sixty
max-sixty merged commit 9c98886 into main Mar 23, 2026
31 of 32 checks passed
@max-sixty
max-sixty deleted the fix/ci-23455369236 branch March 23, 2026 19:50
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix Automated CI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants