Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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.
  • Loading branch information...
bnoordhuis committed Nov 4, 2011
1 parent cf78d04 commit 8974ba31a37f9ef2cea99d9a5c118e33c7bb2497
Showing with 1 addition and 1 deletion.
  1. +1 −1 test/simple/test-net-pipe-connect-errors.js
@@ -39,7 +39,7 @@ var notSocketClient = net.createConnection(
);

notSocketClient.on('error', function (err) {
assert.equal(err.code, 'ENOTSOCK');
assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED');
notSocketErrorFired = true;
});

0 comments on commit 8974ba3

Please sign in to comment.
You can’t perform that action at this time.