Skip to content

Commit

Permalink
test: allow EAI_FAIL in test-http-dns-error.js
Browse files Browse the repository at this point in the history
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 <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
cjihrig authored and targos committed May 4, 2019
1 parent 9d6d45e commit 66cf706
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/parallel/test-http-dns-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ const https = require('https');
const host = '*'.repeat(64);
const MAX_TRIES = 5;

let errCode = 'ENOTFOUND';
if (common.isOpenBSD)
errCode = 'EAI_FAIL';
const errCodes = ['ENOTFOUND', 'EAI_FAIL'];

function tryGet(mod, tries) {
// Bad host name should not throw an uncatchable exception.
Expand All @@ -45,7 +43,7 @@ function tryGet(mod, tries) {
tryGet(mod, ++tries);
return;
}
assert.strictEqual(err.code, errCode);
assert(errCodes.includes(err.code), err);
}));
// http.get() called req1.end() for us
}
Expand All @@ -61,7 +59,7 @@ function tryRequest(mod, tries) {
tryRequest(mod, ++tries);
return;
}
assert.strictEqual(err.code, errCode);
assert(errCodes.includes(err.code), err);
}));
req.end();
}
Expand Down

0 comments on commit 66cf706

Please sign in to comment.