Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

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

worktrunk-bot9c988865e2c4
diff --git a/tests/integration_tests/switch_picker.rs b/tests/integration_tests/switch_picker.rs
index 32c84899d..cc018e995 100644
--- a/tests/integration_tests/switch_picker.rs
+++ b/tests/integration_tests/switch_picker.rs
@@ -484,6 +484,20 @@ fn wait_for_stable_with_content(
);
}
+/// Disable the picker's 500ms data collection timeout so all task results
+/// arrive before rendering. Without this, slow CI runners (especially macOS)
+/// can show `·` stale placeholders for columns whose data didn't arrive in
+/// time, causing non-deterministic snapshots.
+fn disable_picker_timeout(repo: &TestRepo) {
+ let existing = std::fs::read_to_string(repo.test_config_path()).unwrap_or_default();
+ let config = if existing.is_empty() {
+ "skip-commit-generation-prompt = true\n\n[switch-picker]\ntimeout-ms = 0\n".to_string()
+ } else {
+ format!("{existing}\n[switch-picker]\ntimeout-ms = 0\n")
+ };
+ std::fs::write(repo.test_config_path(), config).unwrap();
+}
+
/// Create insta settings with filters for switch picker snapshot stability.
///
/// Replaces the manual `normalize_output()` approach with declarative insta filters.
@@ -522,6 +536,7 @@ fn test_switch_picker_abort_with_escape(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
+ disable_picker_timeout(&repo);
let env_vars = repo.test_env_vars();
let result = exec_in_pty_capture_before_abort(
@@ -547,6 +562,7 @@ fn test_switch_picker_with_multiple_worktrees(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
+ disable_picker_timeout(&repo);
repo.add_worktree("feature-one");
repo.add_worktree("feature-two");
@@ -576,6 +592,7 @@ fn test_switch_picker_with_branches(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
+ disable_picker_timeout(&repo);
repo.add_worktree("active-worktree");
// Create a branch without a worktree
@@ -613,6 +630,7 @@ fn test_switch_picker_preview_panel_uncommitted(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
+ disable_picker_timeout(&repo);
let feature_path = repo.add_worktree("feature");
@@ -673,6 +691,7 @@ fn test_switch_picker_preview_panel_log(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
+ disable_picker_timeout(&repo);
let feature_path = repo.add_worktree("feature");
@@ -732,6 +751,7 @@ fn test_switch_picker_preview_panel_main_diff(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
+ disable_picker_timeout(&repo);
let feature_path = repo.add_worktree("feature");
@@ -824,6 +844,7 @@ fn test_switch_picker_preview_panel_summary(mut repo: TestRepo) {
repo.remove_fixture_worktrees();
// Remove origin so snapshots don't show origin/main
repo.run_git(&["remote", "remove", "origin"]);
+ disable_picker_timeout(&repo);
let feature_path = repo.add_worktree("feature");
@@ -895,6 +916,9 @@ fn test_switch_picker_respects_list_config(mut repo: TestRepo) {
r#"
[list]
branches = true
+
+[switch-picker]
+timeout-ms = 0
"#,
);