diff --git a/DOCS/superpowers/plans/2026-06-09-spacesh-m4.md b/DOCS/superpowers/plans/2026-06-09-spacesh-m4.md index b1361b1..58583cf 100644 --- a/DOCS/superpowers/plans/2026-06-09-spacesh-m4.md +++ b/DOCS/superpowers/plans/2026-06-09-spacesh-m4.md @@ -275,18 +275,18 @@ pub fn socket_path() -> Result { Ok(spacesh_dir()?.join("sock")) } ``` -Add a test in `lifecycle.rs` tests module: +Add a test in `lifecycle.rs` tests module. It mutates the process-global `SPACESH_SOCK`, so it MUST hold `crate::test_support::serial()` for its duration; ALSO add the same guard to the existing `paths_live_under_spacesh_dir` test (the only other test that calls `socket_path()`), or it will intermittently observe the override var and fail: ```rust #[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(); std::env::set_var("SPACESH_SOCK", "/tmp/spacesh-test-override.sock"); let p = socket_path().unwrap(); std::env::remove_var("SPACESH_SOCK"); assert_eq!(p, std::path::PathBuf::from("/tmp/spacesh-test-override.sock")); } ``` +And prepend `let _serial = crate::test_support::serial();` as the first line of the existing `paths_live_under_spacesh_dir` test. - [ ] **Step 4: Initialize idle on every spawn; drop on exit; dispatch SetState**