Repository navigation
fix(test): task-backlog's HOST=localhost server is probed on both loopback families - #16
Merged
Merged
Conversation
…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
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 free
to 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.
test/task-backlog.test.jshas 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 theCCS_TASK_MANAGER_SECRET"not a loopback literal" refusal) binds to::1, while a plainfetch('http://localhost:PORT/...')resolveslocalhostto127.0.0.1only here (getent ahosts localhostconfirms it) and getsECONNREFUSEDagainst 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 both127.0.0.1and[::1]and use whichever answered.Ran 3x clean, then the whole
npm testsuite (all green).🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2ZSHUdJHqVsvSNQ5ZeQ3f