Browse Source

test: fix simple/net-pipe-connect-errors

When trying to connect to something that is not a UNIX socket, Linux returns
ECONNREFUSED, not ENOTSOCK.

We cannot atomically determine if the other end is a) a stale socket, or b) not
a socket at all, so let's accept both error codes.
v0.7.4-release
Ben Noordhuis 14 years ago
parent
commit
8974ba31a3
  1. 2
      test/simple/test-net-pipe-connect-errors.js

2
test/simple/test-net-pipe-connect-errors.js

@ -39,7 +39,7 @@ var notSocketClient = net.createConnection(
); );
notSocketClient.on('error', function (err) { notSocketClient.on('error', function (err) {
assert.equal(err.code, 'ENOTSOCK'); assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED');
notSocketErrorFired = true; notSocketErrorFired = true;
}); });

Loading…
Cancel
Save