Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: test-net-dns-error.js fails on SunOS #31780

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
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
7 changes: 4 additions & 3 deletions test/parallel/test-net-dns-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ const assert = require('assert');
const net = require('net');

const host = '*'.repeat(64);
const errCode = common.isOpenBSD ? 'EAI_FAIL' : 'ENOTFOUND';
// Resolving hostname > 63 characters may return EAI_FAIL (permanent failure).
const errCodes = ['ENOTFOUND', 'EAI_FAIL'];

const socket = net.connect(42, host, common.mustNotCall());
socket.on('error', common.mustCall(function(err) {
assert.strictEqual(err.code, errCode);
assert(errCodes.includes(err.code), err);
}));
socket.on('lookup', common.mustCall(function(err, ip, type) {
assert(err instanceof Error);
assert.strictEqual(err.code, errCode);
assert(errCodes.includes(err.code), err);
assert.strictEqual(ip, undefined);
assert.strictEqual(type, undefined);
}));