It seems that test-net-error-twice.js does not behave as expected. Its goal is to test fireErrorCallbacks, but it doesn't do it correctly, leading to false negatives on some platforms and failures on others .
For a net.Socket object, each write operation are setup to call afterWrite, which itself calls net.Socket.prototype_destroy if the write operation fails.
net.Socket.prototype_destroy in turn calls fireErrorCallbacks, whether the net.Socket object has been already destroyed or not.
This test seems to have been written so that it triggers more than one write by having a buffer that is large enough.
It expects to trigger several errors with these writes by closing the connection on the client side.
and makes sure that fireErrorCallbacks will only emit the same write error once.
However what seems to happen is that at most one write operation fails (which leads to the test succeeding although fireErrorCallbacks has been called only once, and so hasn't been really tested), and sometimes they all succeed (like on SmartOS) which leads to the test failing, but not necessarily for the good reasons.