ci flake: joinEntry live-control-plane test reds on a loopback ECONNRESET (1 of 1258, not reproducible at rest) #882
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#882
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
cirun 12441 (seam stage) reddened on one test out of 1258:Alongside it, in the same worker's output:
What actually happened
dashboard/tests/unit/joinEntry.test.ts:229is the first assertion aftermount —
expect(s3).not.toBeNull()on[data-field="member-joins"]. It failedbecause the surface never rendered S3: the very first live round-trip,
GET /api/v1/join/{token}against the in-test control plane on127.0.0.1:41321, died withECONNRESET, sobootJoinSurfacefell through toSurfaceErrorBoundaryinstead of the branded signup screen.So this is a transport reset, not a logic regression. The join surface's
journey (S3 → S5 → approved) is unchanged and correct; the socket under it
broke.
Why it is a flake, not a regression
dashboard/tests/unit/joinEntry.test.tsanddashboard/src/entry/join.tshave been untouched since
f6585859(2026-07-31, #209). No recent commitshipped this.
matou-workstation), verified bythe healer for run 12441:
joinEntry.test.tsalone: 3/3 green;joinEntry.test.ts× 10 concurrent isolated vitest runs: 10/10 green,zero
ECONNRESETin any log.ba24de31e015— firstoccurrence.
Suspected mechanism
startJoinControlPlanedoesserver.listen(0, '127.0.0.1'), so the controlplane binds a port from the host's ephemeral range (
ip_local_port_range = 32768–60999); the observed 41321 is inside it. On a host churning throughloopback connections (the swarm fires runs every ~15s, plus forgejo-runner,
act, and the registry), an inbound connect to such a port can collide with a
stale/TIME-WAIT 4-tuple and get RST — hence
connect ECONNRESETon a serverthat is demonstrably listening.
tcp_tw_reuse = 2and 22 test files spin livenode:httpservers this way, so the exposure is shared, not unique to thisfile.
The surface has no retry:
dashboard/src/entry/join.ts:57-58handsfetchImplstraight to
httpMemberJoinClient, and a single reset becomes an errorboundary. The test's
settle()(flushPromises→ 30ms →flushPromises)gives it no second chance either.
What a fix should decide
This is a design call for an agent, not a mechanical patch — the honest
options pull in different directions:
and it covers all 22
createServertest files, not just this one. E.g. ashared helper that retries the first connect, or binds outside the ephemeral
range.
(
ECONNRESET/ECONNREFUSED, not HTTP status) — this changes productbehaviour, and a member's phone on a flaky link arguably deserves it. But it
must not mask a genuinely dead control plane: the honest dead end (S3x) and
the error boundary both have to stay reachable (ADR 0100 — no fake in the
composition path).
Option 2 is a real product decision about what the join surface promises a
member when the wire drops; it should not be taken silently as a "test fix".
Evidence
ba24de31e015TypeScript: build (tsc), test (vitest), lint (eslint), exit 1swarm-claim host=matou-dev-server-01 run=12450
(automated multi-host claim — lowest live claim id works this ticket)
Ruled by agent under ADR 0174 — veto anytime.
Took option 1 (the test-harness fix), and deliberately not option 2 (product-side retry).
Ruling: the live-server seam tests bind their control-plane double outside the host ephemeral range instead of
server.listen(0, …). Root cause of the flake is a loopback TCP simultaneous-open:listen(0)hands a port fromip_local_port_range(32768–60999), and on a churning host a clientconnect()can pick that same port as its ephemeral source port → a self-connect the kernel answers with RST (connect ECONNRESET 127.0.0.1:41321, exactly the signature). Binding below the ephemeral floor makes the collision structurally impossible — a client's ephemeral source port can never equal an out-of-range listening port. No retry, no masking.Why it is a two-way door: the change is confined to
dashboard/tests/(a newtests/support/liveServer.tshelper + swapping the identicallisten(0)block in all 22 live-server test files). It is revertible by one commit and ships no product change — the join surface's real transport still has no retry, so the honest S3x dead end andSurfaceErrorBoundarystay reachable (ADR 0100).What proves it: new
tests/unit/liveServer.test.tsasserts the bind lands< 32768, serves the wire, and coexists with a second concurrent bind; full suite green (110 files, 1261 tests),vue-tscandeslintclean.Left for a human (option 2): whether the join transport should retry transport-level faults for a member on a flaky link is a real product decision (
needs_human_decision) — untouched here.close-report for #882 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
d8f60e8189is not reachable from origin/main (not landed)envelope
close-report for #882 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope