Skip to content

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

test(picker): remove dead disable_picker_timeout helper (#2240)

Maximilian Roos14a2f594fd8d
diff --git a/tests/integration_tests/switch_picker.rs b/tests/integration_tests/switch_picker.rs
index 088de6744..172079dfd 100644
--- a/tests/integration_tests/switch_picker.rs
+++ b/tests/integration_tests/switch_picker.rs
@@ -484,20 +484,6 @@ 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.
@@ -536,8 +522,6 @@ 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(
wt_bin().to_str().unwrap(),
@@ -562,8 +546,6 @@ 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");
@@ -592,8 +574,6 @@ 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
let output = repo
@@ -630,8 +610,6 @@ 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");
// First, create and commit a file so we have something to modify
@@ -691,8 +669,6 @@ 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");
// Make several commits in the feature worktree
@@ -751,8 +727,6 @@ 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");
// Make commits in the feature worktree that differ from main
@@ -844,8 +818,6 @@ 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");
// Make a commit so there's content to potentially summarize
@@ -916,9 +888,6 @@ fn test_switch_picker_respects_list_config(mut repo: TestRepo) {
r#"
[list]
branches = true
-
-[switch-picker]
-timeout-ms = 0
"#,
);