Skip to content

fix(test): task-backlog's HOST=localhost server is probed on both loopback families - #16

Merged
Its-My-Work merged 1 commit into
mainfrom
fix/task-backlog-test-localhost-dualstack
Sep 22, 2026
Merged

Its-My-Work merged 1 commit into
mainfrom
fix/task-backlog-test-localhost-dualstack

Conversation

@Its-My-Work

Copy link
Copy Markdown
Owner

test/task-backlog.test.js has been failing in my sandbox (not on GitHub Actions, which stayed green) since before this session. Cause found: this environment's dual-stack resolution is split — the test's third server (HOST=localhost, deliberately a name rather than a literal, to exercise the CCS_TASK_MANAGER_SECRET "not a loopback literal" refusal) binds to ::1, while a plain fetch('http://localhost:PORT/...') resolves localhost to 127.0.0.1 only here (getent ahosts localhost confirms it) and gets ECONNREFUSED against a server that is actually up. The readiness loop then times out and reports the whole file failed.

Not a bug in server.js: the HOST=localhost decision under test does not depend on which literal address the client then uses to reach it. Fix: the two requests to that server try both 127.0.0.1 and [::1] and use whichever answered.

Ran 3x clean, then the whole npm test suite (all green).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y2ZSHUdJHqVsvSNQ5ZeQ3f

…pback families

In some sandboxes this container's own dual-stack resolution is split: the third test
server binds `net.Server.listen(PORT3, 'localhost')` to ::1, while the test client's
plain `fetch('http://localhost:PORT3/...')` resolves 'localhost' to 127.0.0.1 only
(confirmed with `getent ahosts localhost`) and gets ECONNREFUSED against a server that
is, in fact, up — so the readiness loop times out and the whole file is reported as
failed, although the feature under test (create_task backlog/todo/done on the Kanban
board, the CCS_TASK_MANAGER_SECRET refusal on a non-loopback-literal HOST) is fine.
GitHub Actions CI was green throughout, so this is environment-specific, not a bug in
server.js: the server's HOST=localhost decision does not depend on which literal
address the test then uses to reach it. The two requests to that server now try both
127.0.0.1 and [::1] and use whichever answered. Ran 3x clean, then the whole suite.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2ZSHUdJHqVsvSNQ5ZeQ3f
@Its-My-Work
Its-My-Work merged commit 13742a6 into main Sep 22, 2026
1 check passed
Sign up for free to 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.

1 participant