Skip to content

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
MyOwnDataCenter:mainfrom
notsoblack:test/sso-only-fresh-connection-per-request
Open

notsoblack wants to merge 1 commit into
MyOwnDataCenter:mainfrom
notsoblack:test/sso-only-fresh-connection-per-request

Conversation

@notsoblack

Copy link
Copy Markdown

test/sso-only.test.mjs fails on Node 26 at "mode change: shut and cut" with ECONNRESET: 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 req helper now opens a fresh connection per request (agent: false). Nothing else changes; the assertions are the same.

Verification.

  • The fixed file: 6/6 on Node 22.23, 24.23 and 26.12, three runs each.
  • npm test on Node 22: 2642 pass, 0 fail, 6 skipped (same as before the change).
  • npm test on Node 26: 0 fail with the change; without it, the SSO-only test fails every run.
  • npm run typecheck passes.

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.

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