From 69caf47942b4ed4d2b3cd059d0d88c762d73902b Mon Sep 17 00:00:00 2001 From: Yuhao Su <31772373+yuhao-su@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:29:24 -0500 Subject: [PATCH] fix(test): skip creating secret file dir in simulation test (#17772) --- src/common/secret/src/secret_manager.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/secret/src/secret_manager.rs b/src/common/secret/src/secret_manager.rs index 7483ac4d25089..b6a71a4c3ebe8 100644 --- a/src/common/secret/src/secret_manager.rs +++ b/src/common/secret/src/secret_manager.rs @@ -48,6 +48,10 @@ impl LocalSecretManager { .join(cluster_id) .join(worker_id.to_string()); std::fs::remove_dir_all(&secret_file_dir).ok(); + + // This will cause file creation conflict in simulation tests. + // Should skip testing secret files in simulation tests. + #[cfg(not(madsim))] std::fs::create_dir_all(&secret_file_dir).unwrap(); Self { @@ -87,7 +91,10 @@ impl LocalSecretManager { "Failed to remove secret directory") }) .ok(); + + #[cfg(not(madsim))] std::fs::create_dir_all(&self.secret_file_dir).unwrap(); + for secret in secrets { secret_guard.insert(secret.id, secret.value); }