Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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 <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
cjihrig authored and BethGriggs committed Feb 24, 2020
commit f1a8791316a5db1c3727e0a337f87b437cf2635e
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(256);
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