docs(plan): sync M4 lifecycle test with SPACESH_SOCK serial-guard fix

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 22:24:40 +07:00
parent 67c64e5bfe
commit 819e936e6d
@@ -275,18 +275,18 @@ pub fn socket_path() -> Result<PathBuf> {
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**