From db0ca93e94878ca083e7e939975f63f6558c8015 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 4 Sep 2026 07:56:29 +0000 Subject: [PATCH] test: ignore tunnel resets in proxy invalid-char-in-url test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-https-proxy-request-invalid-char-in-url is the only client-proxy test that asserts the proxy logged no socket errors at all. Once the last response has been read the client destroys its tunnel, and if the proxy is still relaying the upstream's TLS close_notify at that point the client answers with a reset, which the proxy records as ECONNRESET on the CONNECT socket. That has been failing the test on macOS even though every request was routed to the sanitized URL. Keep asserting on other errors but leave connection resets out. Signed-off-by: Shelley Vohr PR-URL: https://github.com/nodejs/node/pull/65780 Fixes: https://github.com/nodejs/node/issues/64226 Refs: https://github.com/nodejs/node/issues/59146 Refs: https://github.com/nodejs/node/issues/54534 Reviewed-By: Filip Skokan Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Gürgün Dayıoğlu Reviewed-By: Moshe Atlow --- .../test-https-proxy-request-invalid-char-in-url.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs b/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs index 888137b9a5a..6f27f0775ae 100644 --- a/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs +++ b/test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs @@ -83,7 +83,9 @@ for (const testCase of testCases) { server.close(); assert.deepStrictEqual(requests, expectedUrls); const requestLogs = logs.filter((log) => !('error' in log)); - const errors = logs.filter((log) => 'error' in log); + // The client may reset a tunnel while the proxy is still relaying + // the upstream's TLS shutdown; that says nothing about the URLs. + const errors = logs.filter((log) => 'error' in log && log.error.code !== 'ECONNRESET'); assert.deepStrictEqual(new Set(requestLogs), expectedProxyLogs); assert.deepStrictEqual(errors, []); }));