From 8094d32cbb2af461d2c3d0699b853ca0b4e12826 Mon Sep 17 00:00:00 2001 From: Dave Date: Sun, 22 Mar 2026 14:21:34 +0000 Subject: [PATCH] revert: remove Docker workarounds now that container is fixed Reverts workarounds added by the 361 agent when the hardened Docker container broke the test suite: - gates.rs: restore tempfile::tempdir() (was changed to tempdir_in CARGO_MANIFEST_DIR to avoid noexec /tmp; noexec is now removed) - pool/mod.rs: restore ps -p check in process_is_running (was changed to /proc/ existence check; procps is now installed) Co-Authored-By: Claude Sonnet 4.6 --- server/src/agents/gates.rs | 16 ++++------------ server/src/agents/pool/mod.rs | 7 ++++++- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/server/src/agents/gates.rs b/server/src/agents/gates.rs index cbbf9b4..f27108d 100644 --- a/server/src/agents/gates.rs +++ b/server/src/agents/gates.rs @@ -255,9 +255,7 @@ mod tests { use std::fs; use std::os::unix::fs::PermissionsExt; - let tmp = tempfile::Builder::new() - .tempdir_in(env!("CARGO_MANIFEST_DIR")) - .unwrap(); + let tmp = tempfile::tempdir().unwrap(); let path = tmp.path(); let script_dir = path.join("script"); fs::create_dir_all(&script_dir).unwrap(); @@ -278,9 +276,7 @@ mod tests { use std::fs; use std::os::unix::fs::PermissionsExt; - let tmp = tempfile::Builder::new() - .tempdir_in(env!("CARGO_MANIFEST_DIR")) - .unwrap(); + let tmp = tempfile::tempdir().unwrap(); let path = tmp.path(); let script_dir = path.join("script"); fs::create_dir_all(&script_dir).unwrap(); @@ -316,9 +312,7 @@ mod tests { use std::fs; use std::os::unix::fs::PermissionsExt; - let tmp = tempfile::Builder::new() - .tempdir_in(env!("CARGO_MANIFEST_DIR")) - .unwrap(); + let tmp = tempfile::tempdir().unwrap(); let path = tmp.path(); let script_dir = path.join("script"); fs::create_dir_all(&script_dir).unwrap(); @@ -346,9 +340,7 @@ mod tests { use std::fs; use std::os::unix::fs::PermissionsExt; - let tmp = tempfile::Builder::new() - .tempdir_in(env!("CARGO_MANIFEST_DIR")) - .unwrap(); + let tmp = tempfile::tempdir().unwrap(); let path = tmp.path(); let script_dir = path.join("script"); fs::create_dir_all(&script_dir).unwrap(); diff --git a/server/src/agents/pool/mod.rs b/server/src/agents/pool/mod.rs index c26c6a6..d8426d1 100644 --- a/server/src/agents/pool/mod.rs +++ b/server/src/agents/pool/mod.rs @@ -1101,6 +1101,7 @@ mod tests { use crate::agents::{AgentEvent, AgentStatus, PipelineStage}; use crate::config::ProjectConfig; use portable_pty::{CommandBuilder, PtySize, native_pty_system}; + use std::process::Command; fn make_config(toml_str: &str) -> ProjectConfig { ProjectConfig::parse(toml_str).unwrap() @@ -1187,7 +1188,11 @@ mod tests { /// Returns true if a process with the given PID is currently running. fn process_is_running(pid: u32) -> bool { - std::path::Path::new(&format!("/proc/{pid}")).exists() + Command::new("ps") + .args(["-p", &pid.to_string()]) + .output() + .map(|o| o.status.success()) + .unwrap_or(false) } #[test]