mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
test: ignore EPIPE errors in https proxy invalid URL test
There can be a race from eagerly shutting down the servers and severing two pipes at the same time but for the purpose of this test, we only care about whether the requests are initiated from the client as expected, not how the upstream/proxy servers behave. Ignore EPIPE errors from them. PR-URL: https://github.com/nodejs/node/pull/60269 Refs: https://github.com/nodejs/node/issues/59741 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
parent
8656088090
commit
c2d44174b2
|
|
@ -82,7 +82,19 @@ for (const testCase of testCases) {
|
|||
proxy.close();
|
||||
server.close();
|
||||
assert.deepStrictEqual(requests, expectedUrls);
|
||||
assert.deepStrictEqual(new Set(logs), expectedProxyLogs);
|
||||
const logSet = new Set(logs);
|
||||
for (const log of logSet) {
|
||||
if (log.source === 'proxy connect' && log.error?.code === 'EPIPE') {
|
||||
// There can be a race from eagerly shutting down the servers and severing
|
||||
// two pipes at the same time but for the purpose of this test, we only
|
||||
// care about whether the requests are initiated from the client as expected,
|
||||
// not how the upstream/proxy servers behave. Ignore EPIPE errors from them..
|
||||
// Refs: https://github.com/nodejs/node/issues/59741
|
||||
console.log('Ignoring EPIPE error from proxy connect', log.error);
|
||||
logSet.delete(log);
|
||||
}
|
||||
}
|
||||
assert.deepStrictEqual(logSet, expectedProxyLogs);
|
||||
}));
|
||||
}
|
||||
}));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user