test(daemon): serialize SPACESH_SOCK-mutating lifecycle tests to fix env race
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user