Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

test(cua-driver): stop the proxy recovery test leaking its macOS serve daemons (#5594)

injaneityf927cd12378a
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_proxy_recovery_test.rs b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_proxy_recovery_test.rs
index 9741e03315..ac146644d6 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/protocol_proxy_recovery_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver/tests/protocol_proxy_recovery_test.rs
@@ -180,6 +180,15 @@ fn recovery_idle_seconds() -> u64 {
impl Drop for Process {
fn drop(&mut self) {
+ // An unbundled macOS `serve` re-execs itself, and that grandchild is the
+ // real daemon. It stays in this child's process group (`spawn_in_job`
+ // made the child a group leader), so killing only the child orphans it.
+ #[cfg(unix)]
+ if let Ok(pid) = i32::try_from(self.0.id()) {
+ unsafe {
+ libc::kill(-pid, libc::SIGKILL);
+ }
+ }
let _ = self.0.kill();
let _ = self.0.wait();
}