Skip to content

Commit 75fd2be

Browse files
codebytereaduh95
authored andcommitted
test: ignore tunnel resets in proxy invalid-char-in-url test
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 <shelley.vohr@gmail.com> PR-URL: #65780 Fixes: #64226 Refs: #59146 Refs: #54534 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent 5ac3370 commit 75fd2be

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/client-proxy/test-https-proxy-request-invalid-char-in-url.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ for (const testCase of testCases) {
8383
server.close();
8484
assert.deepStrictEqual(requests, expectedUrls);
8585
const requestLogs = logs.filter((log) => !('error' in log));
86-
const errors = logs.filter((log) => 'error' in log);
86+
// The client may reset a tunnel while the proxy is still relaying
87+
// the upstream's TLS shutdown; that says nothing about the URLs.
88+
const errors = logs.filter((log) => 'error' in log && log.error.code !== 'ECONNRESET');
8789
assert.deepStrictEqual(new Set(requestLogs), expectedProxyLogs);
8890
assert.deepStrictEqual(errors, []);
8991
}));

0 commit comments

Comments
 (0)