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());