From f6bd3b27eeecc52f9327db727217e912130ea929 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 12 Apr 2019 20:54:53 -0700 Subject: [PATCH] test: fix test-dns-idna2008.js The test should pass if ESERVFAIL is the result. Refs: https://github.com/nodejs/node/issues/25870#issuecomment-471024667 PR-URL: https://github.com/nodejs/node/pull/27208 Reviewed-By: Richard Lau Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca --- test/internet/test-dns-idna2008.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/internet/test-dns-idna2008.js b/test/internet/test-dns-idna2008.js index a8d7a3722357ac..5a6a48b6fac39e 100644 --- a/test/internet/test-dns-idna2008.js +++ b/test/internet/test-dns-idna2008.js @@ -43,11 +43,21 @@ dns.promises.lookup(fixture.hostname).then(({ address }) => { }).finally(mustCall()); dns.resolve4(fixture.hostname, mustCall((err, addresses) => { + if (err && err.errno === 'ESERVFAIL') { + assert.ok(err.message.includes('queryA ESERVFAIL straße.de')); + return; + } assert.ifError(err); assert.deepStrictEqual(addresses, [fixture.expectedAddress]); })); const p = new dns.promises.Resolver().resolve4(fixture.hostname); -p.then(mustCall((addresses) => { +p.then((addresses) => { assert.deepStrictEqual(addresses, [fixture.expectedAddress]); -})); +}, (err) => { + if (err && err.errno === 'ESERVFAIL') { + assert.ok(err.message.includes('queryA ESERVFAIL straße.de')); + } else { + throw err; + } +}).finally(mustCall());