From 3a659000c7e553fd6385461720dcbf8883b0e37a Mon Sep 17 00:00:00 2001 From: user Date: Sat, 29 Aug 2026 09:53:48 +0800 Subject: [PATCH] fix(test): drop quoted powershell sleep scripts in terminal exec tests The windows test scripts passed the PowerShell command as one quoted argument (`-Command "Start-Sleep -Milliseconds 250"`); depending on the shell quoting layer this can be parsed as a literal string rather than a command, producing flaky timeouts where the sleep never starts. The four scripts drop the quotes so the tokens reach PowerShell directly. Test: cargo test --locked -p terminal-core --lib --jobs 4 exec (37 passed, 0 failed) AI: This change was assisted by AI and lightly tested. --- src/crates/services/terminal/src/exec.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/crates/services/terminal/src/exec.rs b/src/crates/services/terminal/src/exec.rs index c54b10598e..848767fef8 100644 --- a/src/crates/services/terminal/src/exec.rs +++ b/src/crates/services/terminal/src/exec.rs @@ -1947,7 +1947,7 @@ mod tests { async fn delayed_poll_returns_unread_output_after_process_exit() { let manager = ExecProcessManager::default(); #[cfg(windows)] - let script = "echo first & powershell -NoProfile -Command \"Start-Sleep -Milliseconds 250\" & echo second"; + let script = "echo first & powershell -NoProfile -Command Start-Sleep -Milliseconds 250 & echo second"; #[cfg(not(windows))] let script = "echo first; sleep 0.25; echo second"; @@ -1993,7 +1993,7 @@ mod tests { let manager = ExecProcessManager::default(); let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel(); #[cfg(windows)] - let script = "echo lifecycle_first & powershell -NoProfile -Command \"Start-Sleep -Milliseconds 250\" & echo lifecycle_second"; + let script = "echo lifecycle_first & powershell -NoProfile -Command Start-Sleep -Milliseconds 250 & echo lifecycle_second"; #[cfg(not(windows))] let script = "echo lifecycle_first; sleep 0.25; echo lifecycle_second"; @@ -2096,7 +2096,7 @@ mod tests { async fn tty_poll_after_process_exit_returns_exit_code() { let manager = ExecProcessManager::default(); #[cfg(windows)] - let script = "echo tty_first & powershell -NoProfile -Command \"Start-Sleep -Milliseconds 250\" & echo tty_second"; + let script = "echo tty_first & powershell -NoProfile -Command Start-Sleep -Milliseconds 250 & echo tty_second"; #[cfg(not(windows))] let script = "echo tty_first; sleep 0.25; echo tty_second"; @@ -2243,8 +2243,7 @@ mod tests { async fn control_kill_terminates_running_pipe_session() { let manager = ExecProcessManager::default(); #[cfg(windows)] - let script = - "echo before_kill & powershell -NoProfile -Command \"Start-Sleep -Seconds 30\""; + let script = "echo before_kill & powershell -NoProfile -Command Start-Sleep -Seconds 30"; #[cfg(not(windows))] let script = "echo before_kill; sleep 30";