emrg: GUI integration tests skip when a live daemon owns the fixed port (fixed-port admission regression) - #906
Conversation
…rt (fixed-port admission regression) Since #861 (rant 2026-08-19T08:05:21) the daemon binds a FIXED loopback port (56031) as its single-instance admission, and #884 (rant 2026-08-20T14:32:52) moved the auth credential to emrgd.token (port no longer carried in any file). The GUI integration suite spawns its OWN isolated daemon (HOME->tmp) — on any host where the real daemon is already running (the normal dev-machine state), the isolated daemon cannot bind 56031 (EADDRINUSE) and exits, so every test times out with "daemon token file timeout" (7 failures on ). CI stays green only because runners have no live daemon. Fix: probe 127.0.0.1:56031 at module load; when a live daemon already owns the fixed port, skip the whole suite with a clear message (same mechanism as EMRG_SKIP_INTEGRATION, extended to the live-daemon state — the isolated-daemon premise is impossible there). CI (daemon-free runners) still runs the full suite. Also sync Agent.md GUI test count: 260 -> 254 (renderer.smoke 131->126, i18n 16->15 drifted in #896-#905 without doc re-sync; the doc-count guard only checks breakdown-sum consistency, not actual collection). Verified: pytest 984+1 green, GUI 247 pass / 0 fail (8 skipped on this daemon-hosting host), import + --help OK.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle. Verified locally: the fixed-port probe correctly detects the live daemon and skips the suite (npm test: 247 pass / 0 fail / 8 skipped), pytest 984+1 green (incl. doc-count guard 4/4), import + --help OK. CI (test + test-windows) green on daemon-free runners, where the suite runs in full.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (2/3). Fresh review on branch 80317db: live daemon owns the fixed port on this machine → port probe returns true → whole integration suite skips (npm test: 247 pass / 0 fail / 8 skipped); pytest 984 passed + 1 skipped (doc-count guard intact, Agent.md synced to 254). CI green on daemon-free runners (test + test-windows), where the suite runs in full. Probe logic verified in both states: connect-success → skip; connect-error/timeout → run.
pm25coder
commented
Aug 20, 2026
Independent test report (Contributor, pm25coder) — tested on a live-daemon machine, i.e. exactly the state this PR targets: |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3/3). Third independent review confirming merge conditions: CI green (test + test-windows, run 32427916901), mergeable CLEAN, 2 prior ✅ from different cycles, no ❌. The fixed-port probe correctly auto-skips the integration suite when the real daemon owns 56031 (verified locally: npm test 247 pass / 0 fail / 8 skipped), while CI runners (daemon-free) still run the full suite. Merge.
Uh oh!
There was an error while loading. Please reload this page.
Fixes the GUI integration suite failing (7× "daemon token file timeout") on any host where the real daemon is running.
Problem
Since #861 (rant 2026-08-19T08:05:21) the daemon binds a FIXED loopback port (56031) as its single-instance admission, and #884 (rant 2026-08-20T14:32:52) moved the auth credential to
emrgd.token(port no longer carried in any file). The GUI integration suite spawns its OWN isolated daemon (HOME→tmp) — on any host where the real daemon is already running (the normal dev-machine state: "the server is the living core"), the isolated daemon cannot bind 56031 (EADDRINUSE) and exits → no token file → every test times out. CI stays green only because runners have no live daemon.Changes
emrg/gui/test/integration.test.js: probe127.0.0.1:56031at module load; when a live daemon already owns the fixed port, skip the whole suite with a clear message (same mechanism asEMRG_SKIP_INTEGRATION, extended to the live-daemon state — the isolated-daemon premise is impossible there).before()short-circuits on the same flag so the daemon-spawn timeout never fires. CI (daemon-free runners) still runs the full suite.Agent.md: sync GUI test count 260 → 254 (renderer.smoke 131→126, i18n 16→15 drifted in emrg: GUI task form sandbox field — three-tier select with backend-consistent default #896-emrg: GUI task-run subtable — markdown work/reason + newest-first sort + click-to-expand cells (rant 2026-08-20T22:59:16) #905 without doc re-sync; the doc-count guard only checks breakdown-sum consistency, not actual collection).Verification
npm test: 247 pass / 0 fail / 8 skipped on this daemon-hosting host (was 7 fail)emrg --helpOK