summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-04-30 14:31:20 -0400
committercjihrig <cjihrig@gmail.com>2019-05-02 20:55:46 -0400
commit50364d98d97afd9e7dc3947c270c45ef64944a6f (patch)
tree09de70f551ff4a6d55362bbfa91ce4f7964acacc /test
parentd0667e814e8be53d329a9c7f4849996c192395c9 (diff)
downloadandroid-node-v8-50364d98d97afd9e7dc3947c270c45ef64944a6f.tar.gz
android-node-v8-50364d98d97afd9e7dc3947c270c45ef64944a6f.tar.bz2
android-node-v8-50364d98d97afd9e7dc3947c270c45ef64944a6f.zip
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: https://github.com/nodejs/node/pull/27500 Fixes: https://github.com/nodejs/node/issues/27487 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http-dns-error.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js
index e3d09a39d0..20e12f24fb 100644
--- a/test/parallel/test-http-dns-error.js
+++ b/test/parallel/test-http-dns-error.js
@@ -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.
@@ -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
}
@@ -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();
}