From 565a671e2f4b4b98f22c6f6bc6911c57299138b7 Mon Sep 17 00:00:00 2001 From: Nicholas Yang Date: Wed, 10 May 2023 19:11:13 -0400 Subject: [PATCH] fix(turborepo): Fixed test by killing process when test is done (#4887) ### Description Noticed node errors when running tests. I suspect it's because this node process isn't properly killed on test exit. ### Testing Instructions --- crates/turborepo-lib/src/daemon/endpoint.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/turborepo-lib/src/daemon/endpoint.rs b/crates/turborepo-lib/src/daemon/endpoint.rs index 019a2af135858..3a27f0da42472 100644 --- a/crates/turborepo-lib/src/daemon/endpoint.rs +++ b/crates/turborepo-lib/src/daemon/endpoint.rs @@ -222,7 +222,7 @@ mod test { #[cfg(not(windows))] let node_bin = "node"; - let child = Command::new(node_bin).spawn().unwrap(); + let mut child = Command::new(node_bin).spawn().unwrap(); pid_path .create_with_contents(format!("{}", child.id()).as_ref()) .unwrap(); @@ -236,5 +236,7 @@ mod test { } else { panic!("expected an error") } + + child.kill().unwrap(); } }