Skip to content

Commit 66cf706

Browse files
cjihrigtargos
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 <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 9d6d45e commit 66cf706

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎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(64);
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)