Repository navigation
Tests: the SSO-only test fails on Node 26 (socket hang up) because its client reuses a socket the gate just destroyed - #1281
Open
notsoblack wants to merge 1 commit into
Conversation
…s client reuses a socket the gate just destroyed
When the remote gate closes it destroys every remote socket, keep-alive sockets included. On Node 26 the test's keep-alive client hands one of those sockets to the next request before it has read the reset, so the request after the gate closes fails with ECONNRESET ('socket hang up') instead of the expected status. The gate's behavior is the intended one; the test now opens a fresh connection per request.
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/sso-only.test.mjsfails on Node 26 at "mode change: shut and cut" withECONNRESET: socket hang up, every run. It passes on Node 22 (CI) and on Node 24.Why. When the remote gate closes, the server destroys every remote socket, keep-alive sockets included (
server/app.mjs, "closing remote connections"). The test's client uses Node's default keep-alive agent. On Node 26 that agent hands one of the just-destroyed sockets to the next request before the client has read the reset, so the request sent right after the gate closes dies with "socket hang up" instead of getting the expected status. Node 22 and 24 open a new connection at that point instead.The server's behavior is the intended one (cut the streams now), and no server-side change can help: the request is written to a socket the server has already closed, so it never arrives. The race is in the test's client.
The change. The file's
reqhelper now opens a fresh connection per request (agent: false). Nothing else changes; the assertions are the same.Verification.
npm teston Node 22: 2642 pass, 0 fail, 6 skipped (same as before the change).npm teston Node 26: 0 fail with the change; without it, the SSO-only test fails every run.npm run typecheckpasses.A 25-line repro without any server code (a server that destroys a keep-alive socket right after answering, and a client that sends the next request on the default agent) fails on Node 26 and passes on 22 and 24, if you want to check the Node behavior itself.