diff --git a/e2e/utils/assertions.bash b/e2e/utils/assertions.bash index 4faca9a149..66d0e5df7f 100644 --- a/e2e/utils/assertions.bash +++ b/e2e/utils/assertions.bash @@ -149,7 +149,7 @@ assert_process_exits() { # Asserts that `dfx start` and `replica` are no longer running assert_no_dfx_start_or_replica_processes() { ! ( ps | grep "[/[:space:]]dfx start" ) - ! ( ps | cat .dfx/replica-configuration/replica-pid ) + ! ( kill -0 $(cat .dfx/replica-configuration/replica-pid) 2>/dev/null ) } assert_file_eventually_exists() { diff --git a/src/dfx/src/commands/replica.rs b/src/dfx/src/commands/replica.rs index 8e1153a74e..8da68dc9f2 100644 --- a/src/dfx/src/commands/replica.rs +++ b/src/dfx/src/commands/replica.rs @@ -125,13 +125,16 @@ pub fn exec(env: &dyn Environment, opts: ReplicaOpts) -> DfxResult { }) .start(); + let replica_configuration_dir = env.get_temp_dir().join("replica-configuration"); + std::fs::create_dir_all(&replica_configuration_dir)?; + let _replica_addr = actors::replica::Replica::new(actors::replica::Config { ic_starter_path: ic_starter_pathbuf, replica_config: config, replica_path: replica_pathbuf, shutdown_controller, logger: Some(env.get_logger().clone()), - replica_configuration_dir: env.get_temp_dir().join("replica-configuration"), + replica_configuration_dir, }) .start();