emrg: isolate stop_daemon in test_stop_all_process_residual_still_aborts (⛔ host red line) - #889
Merged
Merged
Conversation
…rts (⛔ host red line) The test called _stop_all.stop_all() without monkeypatching stop_daemon, which REALLY connects to ws://127.0.0.1:56031 and shuts down the running emrgd — observed twice on 2026-08-20 16:18/16:25 (emrgd.log 'shutdown requested by client (source=stop_all)') while running the full pytest suite. The other two stop_all() tests in the file already isolate stop_daemon; this one was the missed spot. Fix: add monkeypatch.setattr(_stop_all, 'stop_daemon', lambda: None) with a ⛔ red-line comment, matching the file's convention. Full-suite audit confirms no other un-isolated stop_all()/stop_daemon() real-execution tests remain (test_installer_stop.py is static source analysis; scheduler stop_all() stops handler coroutines, not the daemon).
argszero
commented
Aug 20, 2026
argszero
left a comment
OwnerAuthor
There was a problem hiding this comment.
✅ LGTM — cycle 1 (single-file ⛔ red-line fix: stop_daemon isolated in the missed test, matching file convention; full-suite audit confirms no other un-isolated stop paths; pytest 980 green with daemon alive; test + test-windows CI PASS)
argszero
commented
Aug 20, 2026
argszero
left a comment
OwnerAuthor
There was a problem hiding this comment.
✅ LGTM — cycle 2 (independent re-review: single-file change adds stop_daemon monkeypatch isolation to the missed test, matching the same-file convention; ⛔ red-line comment documents the 2026-08-20 16:18/16:25 real-daemon kill evidence; test + test-windows CI PASS)
Uh oh!
There was an error while loading. Please reload this page.
argszero added a commit
that referenced
this pull request
Aug 20, 2026
…ails loudly (⛔ red line backstop) (#890) 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. Co-authored-by: EMRG Evolution <emrg@argszero.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix a ⛔ host-red-line violation (host directive 2026-08-18T22:58): running the full pytest suite killed the real local emrgd twice (2026-08-20 16:18/16:25) because
test_stop_all_process_residual_still_abortscalled_stop_all.stop_all()without isolatingstop_daemon—stop_daemon()really connects to ws://127.0.0.1:56031 and sends shutdown to the running daemon.Fix
tests/test_stop_all.pyline 677 test: addwith a ⛔ red-line comment explaining why (matches the file's existing isolation convention — the other two stop_all() tests already do this).
Audit (rant acceptance item 2)
_stop_all.stop_all()test call sites (lines 656 / 681 / 968) now isolatestop_daemontest_scheduler.pysched.stop_all()= TaskScheduler method (stops handler coroutines, NOT the daemon process) — safetest_installer_stop.py= static source analysis, never executes stop paths — safeVerification
pytest tests/test_stop_all.py::TestIndependentLockProbe→ 10 passed, 0.28s, no shutdown triggereduv run pytest tests/→ 980 passed + 1 skipped, daemon stays alive after the suite