From 819e936e6d3e63cc0fef47122b0e90d6e68326ca Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Tue, 9 Jun 2026 22:24:40 +0700 Subject: [PATCH] docs(plan): sync M4 lifecycle test with SPACESH_SOCK serial-guard fix Co-Authored-By: Claude Opus 4.8 (1M context) --- DOCS/superpowers/plans/2026-06-09-spacesh-m4.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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**