diff --git a/.gitignore b/.gitignore index 20348359a4..7d9bf1115c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target -/tmp_check/ +/tmp_check /tmp_install +/tmp_check_cli diff --git a/control_plane/src/compute.rs b/control_plane/src/compute.rs index 9de4a3b8c6..10e75ec5cb 100644 --- a/control_plane/src/compute.rs +++ b/control_plane/src/compute.rs @@ -198,9 +198,11 @@ impl PostgresNode { // initialize data directory if self.is_test { - fs::remove_dir_all(self.pgdata().to_str().unwrap())?; + fs::remove_dir_all(self.pgdata().to_str().unwrap()).ok(); } + fs::create_dir_all(self.pgdata().to_str().unwrap())?; + let initdb_path = self.env.pg_bin_dir().join("initdb"); let initdb = Command::new(initdb_path) .args(&["-D", self.pgdata().to_str().unwrap()]) diff --git a/control_plane/src/local_env.rs b/control_plane/src/local_env.rs index 4ec4a82a50..265d28629e 100644 --- a/control_plane/src/local_env.rs +++ b/control_plane/src/local_env.rs @@ -120,7 +120,7 @@ pub fn init() -> Result<()> { // ok, we are good to go // create dirs - let data_dir = cargo_path.join("tmp_check"); + let data_dir = cargo_path.join("tmp_check_cli"); for &dir in &["compute", "pageserver"] { fs::create_dir_all(data_dir.join(dir)) @@ -168,7 +168,7 @@ pub fn load_config() -> Result { // local env for tests pub fn test_env() -> LocalEnv { - let data_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("tmp_check"); + let data_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../tmp_check"); fs::create_dir_all(data_dir.clone()).unwrap(); LocalEnv { data_dir,