emrg: conftest hermeticity guard — un-isolated stop_daemon calls fail loudly (⛔ red line backstop) - #890
Conversation
…ails loudly (⛔ red line backstop) The 2026-08-20 16:18/16:25 incidents killed the live emrgd twice because tests/test_stop_all.py:677 lacked stop_daemon isolation. PR #889 fixed the specific leak; this adds the definitive anti-regression layer: an autouse conftest fixture replaces emrg._stop_all.stop_daemon with a raiser so any future test that triggers a real stop path fails with AssertionError instead of killing the daemon. A canary test verifies the guard stays installed. Agent.md pytest count synced 981 -> 982.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 1 (3 files +37/−1: conftest autouse guard replaces _stop_all.stop_daemon with a raiser — the ⛔ red-line backstop that makes any future un-isolated stop path fail loudly instead of killing the live daemon; canary test checks guard identity without touching stop paths; Agent.md count synced; pytest 981 passed + 1 skipped with daemon alive; test + test-windows CI PASS)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 2 (independent re-review: conftest autouse guard correctly replaces _stop_all.stop_daemon with a raiser (⛔ red-line backstop); existing isolated tests patch after the fixture and override as designed; canary checks guard identity only; Agent.md 982 sync correct; test + test-windows CI PASS)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 3 (re-review: head 000e4f4 unchanged, 3 files +37/−1; conftest autouse guard is the ⛔ red-line backstop making any un-isolated stop_daemon call fail loudly; canary verifies guard installation; Agent.md 982 synced; test + test-windows CI PASS, mergeable CLEAN)
Summary
The 2026-08-20 16:18/16:25 incidents killed the live emrgd twice because
tests/test_stop_all.py:677lackedstop_daemonisolation (host red line 2026-08-18T22:58, rant 2026-08-20T16:32:30). PR #889 fixed the specific leak; this PR adds the definitive anti-regression layer.Changes
_guard_stop_daemon_hermeticity: replacesemrg._stop_all.stop_daemonwith a raiser, so any future test that triggers a real stop path fails withAssertionErrorinstead of killing the live daemon. Tests that properly isolate it (monkeypatch.setattr(_stop_all, "stop_daemon", lambda: None)) patch after the fixture and override it as usual.TestStopDaemonHermeticityGuardverifies the guard stays installed (checks function identity only, never calls stop paths).Verification
~/.emrg/install/bin/python -m emrg) stayed alive through the entire run — guard confirmed effective