From 6fc099bb6fa4d066daac75442901cf3fe42d2ebd Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Tue, 9 Jun 2026 22:23:41 +0700 Subject: [PATCH] test(daemon): serialize SPACESH_SOCK-mutating lifecycle tests to fix env race Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/spaceshd/src/lifecycle.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/spaceshd/src/lifecycle.rs b/crates/spaceshd/src/lifecycle.rs index 26d3736..3412c45 100644 --- a/crates/spaceshd/src/lifecycle.rs +++ b/crates/spaceshd/src/lifecycle.rs @@ -56,6 +56,7 @@ mod tests { #[test] fn paths_live_under_spacesh_dir() { + let _serial = crate::test_support::serial(); let dir = spacesh_dir().unwrap(); assert!(socket_path().unwrap().starts_with(&dir)); assert!(lock_path().unwrap().starts_with(&dir)); @@ -75,8 +76,9 @@ mod tests { #[test] fn socket_path_honors_env_override() { - // Note: set/remove around the assertion; tests in this module run serially enough, - // but guard by restoring afterwards. + let _serial = crate::test_support::serial(); + // Note: set/remove around the assertion; serialized against the other + // env-sensitive lifecycle test via the crate's serial() lock. std::env::set_var("SPACESH_SOCK", "/tmp/spacesh-test-override.sock"); let p = socket_path().unwrap(); std::env::remove_var("SPACESH_SOCK");