Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
test: fix simple/net-pipe-connect-errors
Browse files Browse the repository at this point in the history
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 8974ba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/simple/test-net-pipe-connect-errors.js
Expand Up @@ -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;
});

Expand Down

0 comments on commit 8974ba3

Please sign in to comment.