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

test-net-error-twice.js seems to not behave as expected #9325

Closed
misterdjules opened this issue Mar 4, 2015 · 1 comment
Closed

test-net-error-twice.js seems to not behave as expected #9325

misterdjules opened this issue Mar 4, 2015 · 1 comment

Comments

@misterdjules
Copy link

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.

@misterdjules
Copy link
Author

To be more precise, it fails on one of our SmartOS Jenkins agent, but when running the same test in a SmartOS VM, the test passes with the following output:

$ ./node test/simple/test-net-error-twice.js 
[ { [Error: write EPIPE] code: 'EPIPE', errno: 'EPIPE', syscall: 'write' } ]
$

misterdjules pushed a commit to misterdjules/node that referenced this issue Jul 23, 2015
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.
This change marks this test as flaky so that we can use our CI to land
changes in the v0.10 branch until we can fix it properly.

See the corresponding issue at
nodejs#9325 for more details.
misterdjules pushed a commit to misterdjules/node that referenced this issue Jul 23, 2015
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.
This change marks this test as flaky so that we can use our CI to land
changes in the v0.10 branch until we can fix it properly.

See the corresponding issue at
nodejs#9325 for more details.

PR: nodejs#25760
PR-URL: nodejs#25760
Reviewed-By: João Reis <[email protected]>
@Trott Trott closed this as completed Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants