Skip to content

fix(orchestrator-cli): recover from poisoned env lock in tests#202

Merged
Shooksie merged 1 commit intomainfrom
fix/test-env-lock-poison-recovery
Apr 1, 2026
Merged

fix(orchestrator-cli): recover from poisoned env lock in tests#202
Shooksie merged 1 commit intomainfrom
fix/test-env-lock-poison-recovery

Conversation

@Shooksie
Copy link
Copy Markdown
Contributor

@Shooksie Shooksie commented Apr 1, 2026

Summary

  • Replace .lock().expect(...) with .lock().unwrap_or_else(|p| p.into_inner()) on all test_env_lock() call sites across 13 files in orchestrator-cli
  • When a test panics, std::sync::Mutex becomes poisoned. The previous .expect() calls caused every subsequent test to also panic, turning 1 real failure into 34 cascade failures
  • The new pattern recovers the lock guard from a poisoned mutex, isolating failures to the test that actually broke

Test plan

  • cargo fmt -p orchestrator-cli — clean
  • cargo clippy -p orchestrator-cli — no new warnings
  • cargo test -p orchestrator-cli — 272 passed, 1 failed (pre-existing daemon_run_emits_task_state_change_events, unrelated to this change)

Fixes #201

🤖 Generated with Claude Code

Replace .expect() with .unwrap_or_else(|p| p.into_inner()) on all
test_env_lock() acquisitions. A panicking test previously poisoned the
shared Mutex, causing 33 unrelated tests to cascade-fail.

Fixes #201

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Shooksie Shooksie merged commit 41ca734 into main Apr 1, 2026
24 checks passed
@Shooksie Shooksie deleted the fix/test-env-lock-poison-recovery branch April 1, 2026 01:24
This was referenced Apr 8, 2026
Shooksie added a commit that referenced this pull request Apr 8, 2026
Replace .expect() with .unwrap_or_else(|p| p.into_inner()) on all
test_env_lock() acquisitions. A panicking test previously poisoned the
shared Mutex, causing 33 unrelated tests to cascade-fail.

Fixes #201

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 34 test failures due to Mutex poison cascade in test_env_lock

1 participant