-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: fix flaky http-server-keep-alive-timeout #20093
test: fix flaky http-server-keep-alive-timeout #20093
Conversation
Make sure the connection is not closed until the 3 requests and the `timeout` event are received. Some code refactoring to avoid duplicated code. Fixes: nodejs#20013
test(function serverEndKeepAliveTimeoutWithPipeline(cb) { | ||
function done(server, socket, cb) { | ||
socket.destroy(); | ||
server.close(); |
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.
Nit: I'd pass the callback to close()
instead of calling it explicitly.
cb(); | ||
} | ||
|
||
function server_test(with_pipeline, cb) { |
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.
Nit: use camel case.
Stress test on FreeBSD 10: https://ci.nodejs.org/job/node-stress-single-test/1818/ |
Doesn't look like it survived the stress test. 😞 Edit: I stopped the stress test since it was clearly not successful. Here are the results at that point in time:
|
Yeah, the underlying issue seems to be that calling |
Stress test should be: https://ci.nodejs.org/job/node-stress-single-test/1820/ |
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.
Stress test failed. :-(
server.close(cb); | ||
} | ||
|
||
function serverTest(with_pipeline, cb) { |
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.
Nit: there are still a couple of snake case variables. Would you mind fixing those before of when landing? Thanks.
Make sure the connection is not closed until the 3 requests and the `timeout` event are received. Some code refactoring to avoid duplicated code. Fixes: #20013 PR-URL: #20093 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Landed in 998e174 with nit addressed. Thanks! |
Make sure the connection is not closed until the 3 requests and the `timeout` event are received. Some code refactoring to avoid duplicated code. Fixes: #20013 PR-URL: #20093 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Make sure the connection is not closed until the 3 requests and the
timeout
event are received.Some code refactoring to avoid duplicated code.
Fixes: #20013
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes