Browse Source

test: change the hostname to an invalid name

In my Ubuntu 14.04.2 LTS machine, it tries to resolve the name
'blah.blah' and it fails with ETIMEOUT instead of ENOTFOUND. This patch
changes the hostname to "...", an invalid name, so that it will fail
immediately.

PR-URL: https://github.com/nodejs/io.js/pull/2287
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
v4.0.0-rc
Sakthipriyan Vairamani 10 years ago
parent
commit
64cf71195c
  1. 4
      test/parallel/test-net-better-error-messages-port-hostname.js

4
test/parallel/test-net-better-error-messages-port-hostname.js

@ -3,12 +3,12 @@ var common = require('../common');
var net = require('net');
var assert = require('assert');
var c = net.createConnection(common.PORT, 'blah.blah');
var c = net.createConnection(common.PORT, '...');
c.on('connect', assert.fail);
c.on('error', common.mustCall(function(e) {
assert.equal(e.code, 'ENOTFOUND');
assert.equal(e.port, common.PORT);
assert.equal(e.hostname, 'blah.blah');
assert.equal(e.hostname, '...');
}));

Loading…
Cancel
Save