From 19838b11c63b07d5385fea09330c8e1ab1133981 Mon Sep 17 00:00:00 2001 From: Mattie Conover Date: Fri, 4 Aug 2023 09:24:03 -0700 Subject: [PATCH] E2E test `pkill` anvil (#2607) ### Description Fixes a minor bug when testing locally where sometimes a failure in the e2e test will not correctly clean up anvil. This just runs `pkill -SIGKILL anvil` to clean it up if it was running. ### Drive-by changes None ### Related issues ### Backward compatibility Yes ### Testing Manual --- rust/utils/run-locally/src/ethereum.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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");