refactor: better tombstone handling

This commit is contained in:
zhom
2026-03-17 13:15:48 +04:00
parent 222a8b89f5
commit 96614a3f33
14 changed files with 209 additions and 59 deletions
+6 -4
View File
@@ -2741,17 +2741,19 @@ mod tests {
fn test_process_running_detection_with_child_lifecycle() {
use crate::proxy_storage::is_process_running;
// Spawn a long-lived child so we can check while it runs
let mut child = std::process::Command::new(if cfg!(windows) { "timeout" } else { "sleep" })
// Spawn a long-lived child so we can check while it runs.
// On Windows, `timeout` requires console input and exits immediately in
// non-interactive contexts, so use `ping` with a high count instead.
let mut child = std::process::Command::new(if cfg!(windows) { "ping" } else { "sleep" })
.args(if cfg!(windows) {
vec!["/T", "10"]
vec!["-n", "100", "127.0.0.1"]
} else {
vec!["10"]
})
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.spawn()
.expect("spawn sleep");
.expect("spawn long-lived child");
let pid = child.id();