mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 09:02:40 +00:00

On my slow Ubuntu 14.04 machine, this fails to resolve the host name used (`no.way.you.will.resolve.this`) and it times out in local testing. This patch uses an invalid name (`...`) and does stricter validation of the error returned. PR-URL: https://github.com/nodejs/node/pull/3711 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
18 lines
488 B
JavaScript
18 lines
488 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const net = require('net');
|
|
|
|
const client = net.connect({host: '...', port: common.PORT});
|
|
|
|
client.once('error', common.mustCall(function(err) {
|
|
assert(err);
|
|
assert.strictEqual(err.code, err.errno);
|
|
assert.strictEqual(err.code, 'ENOTFOUND');
|
|
assert.strictEqual(err.host, err.hostname);
|
|
assert.strictEqual(err.host, '...');
|
|
assert.strictEqual(err.syscall, 'getaddrinfo');
|
|
}));
|
|
|
|
client.end();
|