Skip to content
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 http-agent-destroyed-socket cb not firing #20006

Conversation

apapirovski
Copy link
Member

A whole part of the test-http-agent-destroyed-socket test was not running as the semantics of http events changed slightly and were no longer triggering the expected event. Instead listen to the same event on the socket to verify that the code being tested is still working as expected.

Fixes: #8613

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

A whole part of the test-http-agent-destroyed-socket test
was not running as the semantics of http events changed
slightly and were no longer triggering the expected event.
Instead listen to the same event on the socket to verify
that the code being tested is still working as expected.
@apapirovski apapirovski added the http Issues or PRs related to the http subsystem. label Apr 13, 2018
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Apr 13, 2018
@apapirovski
Copy link
Member Author

// socket manually at just the right time, but at Voxer we have
// seen cases where the socket is destroyed by non-user code
// then handed out again by an agent *before* the 'close' event
// is triggered.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is no longer relevant hence the removal.

@BridgeAR
Copy link
Member

Ping @nodejs/http @nodejs/http2 @nodejs/streams

@@ -47,21 +47,9 @@ const server = http.createServer(common.mustCall((req, res) => {
request1.socket.on('close', common.mustCall());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I guess this is redundant now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point. Will fix in the morning. Thanks!

@apapirovski
Copy link
Member Author

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 15, 2018
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lpinca
Copy link
Member

lpinca commented Apr 17, 2018

Landed in 15e136d.

@lpinca lpinca closed this Apr 17, 2018
lpinca pushed a commit that referenced this pull request Apr 17, 2018
A whole part of the test-http-agent-destroyed-socket test
was not running as the semantics of http events changed
slightly and were no longer triggering the expected event.
Instead listen to the same event on the socket to verify
that the code being tested is still working as expected.

PR-URL: #20006
Fixes: #8613
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell pushed a commit that referenced this pull request Apr 17, 2018
A whole part of the test-http-agent-destroyed-socket test
was not running as the semantics of http events changed
slightly and were no longer triggering the expected event.
Instead listen to the same event on the socket to verify
that the code being tested is still working as expected.

PR-URL: #20006
Fixes: #8613
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@apapirovski apapirovski deleted the fix-http-test-agent-destroyed-socket branch April 18, 2018 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

response's close event not being triggered
7 participants