Skip to content

Commit

Permalink
test: change the hostname to an invalid name
Browse files Browse the repository at this point in the history
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: #2287
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
  • Loading branch information
thefourtheye committed Aug 3, 2015
1 parent 80a1cf7 commit 64cf711
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-net-better-error-messages-port-hostname.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '...');
}));

0 comments on commit 64cf711

Please sign in to comment.