From 90ed91608eabae6fbab01e42f333a685934d2cc5 Mon Sep 17 00:00:00 2001 From: John Shin Date: Wed, 24 May 2023 16:50:08 -0700 Subject: [PATCH] mkdir: document why a mutex is necessary --- tests/by-util/test_mkdir.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/by-util/test_mkdir.rs b/tests/by-util/test_mkdir.rs index 308df4805..425be8c35 100644 --- a/tests/by-util/test_mkdir.rs +++ b/tests/by-util/test_mkdir.rs @@ -6,6 +6,10 @@ use once_cell::sync::Lazy; use std::os::unix::fs::PermissionsExt; use std::sync::Mutex; +// tests in `test_mkdir.rs` cannot run in parallel since some tests alter the umask. This may cause +// other tests to run under a wrong set of permissions +// +// when writing a test case, acquire this mutex before proceeding with the main logic of the test static TEST_MUTEX: Lazy> = Lazy::new(|| Mutex::new(())); static TEST_DIR1: &str = "mkdir_test1";