From cbb114249767bb8eff28040347453b0364490c0e Mon Sep 17 00:00:00 2001 From: Hunter B Date: Thu, 4 Jun 2026 19:34:52 -0700 Subject: [PATCH] test(shell): #2528 widen background completion wait Widen the focused background-shell completion wait used by shell tests so slow Windows runners do not leave lightweight background commands reported as Running before assertions fire. Refs #2525 Refs #2526 Harvested from PR #2528 by @cyq1017 Co-authored-by: cyq1017 <61975706+cyq1017@users.noreply.github.com> --- crates/tui/src/tools/shell/tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/tui/src/tools/shell/tests.rs b/crates/tui/src/tools/shell/tests.rs index 46b7c35b..9708ea56 100644 --- a/crates/tui/src/tools/shell/tests.rs +++ b/crates/tui/src/tools/shell/tests.rs @@ -21,6 +21,8 @@ fn env_lock() -> &'static Mutex<()> { LOCK.get_or_init(|| Mutex::new(())) } +const BACKGROUND_COMPLETION_WAIT_MS: u64 = 30_000; + #[cfg(windows)] const JOB_OBJECT_QUERY_ACCESS: u32 = 0x0004; @@ -133,7 +135,7 @@ fn failed_network_shell_result(stdout: &str, stderr: &str) -> ShellResult { } fn wait_for_completed_shell(manager: &mut ShellManager, task_id: &str) -> ShellResult { - let deadline = Instant::now() + Duration::from_secs(20); + let deadline = Instant::now() + Duration::from_millis(BACKGROUND_COMPLETION_WAIT_MS); loop { let result = manager @@ -801,7 +803,7 @@ async fn test_completed_background_shell_releases_process_handles() { json!({ "task_id": task_id.clone(), "wait": true, - "timeout_ms": 5_000 + "timeout_ms": BACKGROUND_COMPLETION_WAIT_MS }), &ctx, )