test: deflake connection refused proxy tests · nodejs/node@0930c21 · GitHub
Skip to content

Commit 0930c21

Browse files
joyeecheungtargos
authored andcommitted
test: deflake connection refused proxy tests
Previously the tests tries to use UDP ports to fabricate ECONNREFUSED which is incorrect - UDP ports use different namespaces, so the port can have valid TCP listeners. This patch updates the test to fabricate the ECONNREFUSED error by using the port of a recently closed HTTP server. If the ephemeral port happens to be still open, try to get a different one until we succeed. PR-URL: #59476 Refs: nodejs/reliability#1287 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent b3af17c commit 0930c21

2 files changed

Lines changed: 61 additions & 41 deletions

File tree

test/client-proxy/test-http-proxy-request-connection-refused.mjs

Lines changed: 30 additions & 21 deletions

test/client-proxy/test-https-proxy-request-connection-refused.mjs

Lines changed: 31 additions & 20 deletions

0 commit comments

Comments
 (0)