Skip to content

Commit f1a8791

Browse files
cjihrigBethGriggs
authored andcommitted
test: allow EAI_FAIL in test-http-dns-error.js
EAI_FAIL is expected on OpenBSD, and has been observed on platforms such as FreeBSD and Windows. This commit makes EAI_FAIL an acceptable error code on all platforms. PR-URL: #27500Fixes: #27487 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 4b9a779 commit f1a8791

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎test/parallel/test-http-dns-error.js‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ const https = require('https');
3232
consthost='*'.repeat(256);
3333
constMAX_TRIES=5;
3434

35-
leterrCode='ENOTFOUND';
36-
if(common.isOpenBSD)
37-
errCode='EAI_FAIL';
35+
consterrCodes=['ENOTFOUND','EAI_FAIL'];
3836

3937
functiontryGet(mod,tries){
4038
// Bad host name should not throw an uncatchable exception.
@@ -45,7 +43,7 @@ function tryGet(mod, tries){
4543
tryGet(mod,++tries);
4644
return;
4745
}
48-
assert.strictEqual(err.code,errCode);
46+
assert(errCodes.includes(err.code),err);
4947
}));
5048
// http.get() called req1.end() for us
5149
}
@@ -61,7 +59,7 @@ function tryRequest(mod, tries){
6159
tryRequest(mod,++tries);
6260
return;
6361
}
64-
assert.strictEqual(err.code,errCode);
62+
assert(errCodes.includes(err.code),err);
6563
}));
6664
req.end();
6765
}

0 commit comments

Comments
(0)