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:
parent
cf78d04ae2
commit
8974ba31a3
@ -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…
x
Reference in New Issue
Block a user