Skip to content

Commit

Permalink
fix(turborepo): Fixed test by killing process when test is done (#4887)
Browse files Browse the repository at this point in the history
### Description

Noticed node errors when running tests. I suspect it's because this node
process isn't properly killed on test exit.

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
  • Loading branch information
NicholasLYang committed May 10, 2023
1 parent 289fd85 commit 565a671
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/turborepo-lib/src/daemon/endpoint.rs
Expand Up @@ -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();
Expand All @@ -236,5 +236,7 @@ mod test {
} else {
panic!("expected an error")
}

child.kill().unwrap();
}
}

0 comments on commit 565a671

Please sign in to comment.