diff --git a/rust/utils/run-locally/src/ethereum.rs b/rust/utils/run-locally/src/ethereum.rs index bc55f7472..2119ae550 100644 --- a/rust/utils/run-locally/src/ethereum.rs +++ b/rust/utils/run-locally/src/ethereum.rs @@ -21,6 +21,14 @@ pub fn start_anvil(config: Arc) -> AgentHandles { } yarn_monorepo.clone().cmd("build").run().join(); + if !config.is_ci_env { + // Kill any existing anvil processes just in case since it seems to have issues getting cleaned up + Program::new("pkill") + .raw_arg("-SIGKILL") + .cmd("anvil") + .run_ignore_code() + .join(); + } log!("Launching anvil..."); let anvil_args = Program::new("anvil").flag("silent").filter_logs(|_| false); // for now do not keep any of the anvil logs let anvil = anvil_args.spawn("ETH");