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.
This commit is contained in:
Ben Noordhuis 2011-11-04 05:28:30 +01:00
parent cf78d04ae2
commit 8974ba31a3

View File

@ -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;
});