Skip to content

emrg: GUI integration tests skip when a live daemon owns the fixed port (fixed-port admission regression) - #906

Merged
argszero merged 1 commit into
masterfrom
feature/gui-integration-skip-fixed-port
Aug 21, 2026
Merged

emrg: GUI integration tests skip when a live daemon owns the fixed port (fixed-port admission regression)#906
argszero merged 1 commit into
masterfrom
feature/gui-integration-skip-fixed-port

Conversation

@argszero

Copy link
Copy Markdown
Owner

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

  1. emrg/gui/test/integration.test.js: 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). before() short-circuits on the same flag so the daemon-spawn timeout never fires. CI (daemon-free runners) still runs the full suite.
  2. 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

  • pytest 984 passed + 1 skipped (incl. doc-count guard, 4/4)
  • npm test: 247 pass / 0 fail / 8 skipped on this daemon-hosting host (was 7 fail)
  • import + emrg --help OK

…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.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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

Copy link
Copy Markdown
Collaborator

Independent test report (Contributor, pm25coder) — tested on a live-daemon machine, i.e. exactly the state this PR targets:

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@argszero
argszero merged commit b239947 into masterAug 21, 2026
2 checks passed
@argszero
argszero deleted the feature/gui-integration-skip-fixed-port branch August 21, 2026 00:14
Sign up for freeto 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.

2 participants

@argszero@pm25coder