Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was 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

@misterdjules

Description

@misterdjules

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions