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: #27500 Fixes: #27487 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 9d6d45e commit 66cf706

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ const https = require('https');
3232
const host = '*'.repeat(64);
3333
const MAX_TRIES = 5;
3434

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

3937
function tryGet(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)