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
dan/rust-caching
Mattie Conover 1 year ago committed by GitHub
parent 9045f8362e
commit 19838b11c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      rust/utils/run-locally/src/ethereum.rs

@ -21,6 +21,14 @@ pub fn start_anvil(config: Arc<Config>) -> AgentHandles {
} }
yarn_monorepo.clone().cmd("build").run().join(); 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..."); 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_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"); let anvil = anvil_args.spawn("ETH");

Loading…
Cancel
Save