-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: deflake test-http-destroyed-socket-write2 #36120
Conversation
was failing before with timeouts on macOS, now it exits with 0. |
}); | ||
} | ||
server.once(kResponseDestroyed, common.mustCall(function() { | ||
req.write('hello'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need for .mustCall
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise there is no guarantee that the listener of the 'request'
event added on line 33 is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway we can use common.mustCall()
there (line 33) if it is easier to grok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I misunderstood. Do you mean adding a callback to this req.write()
? If so, I think it is not needed. It's out of the scope of the test.
Ensure that the write occurs in the same tick where the socket is destroyed by the other peer. PR-URL: nodejs#36120 Fixes: nodejs#36081 Fixes: nodejs#4066 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Landed in e682814. |
Ensure that the write occurs in the same tick where the socket is
destroyed by the other peer.
Fixes: #36081
Fixes: #4066
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes