-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
http2: correct emit error in onConnect, full tests #15080
http2: correct emit error in onConnect, full tests #15080
Conversation
Correct requestOnConnect to emit session error on NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE rather than stream error. Add full test suite for the error handling within requestOnConnect. Refs: nodejs#14985
45afbb7
to
89ea398
Compare
This change is ok. Can you remove I think it would be easier to debug in this way. |
It looks like right now only the event emits (in fact, looks like only the errors) are being run on nextTick, whereas a lot of the other stuff might be sync? So I guess I just wanted to confirm that we're ok with moving this up to where |
@apapirovski maybe not - what do you think @jasnell? |
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.
LGTM with green CI!
Thank you!
@mcollina ... I think I'm ok with this but would like your opinion on it as well. If you're not convinced we can talk it through and figure out what's better |
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.
LGTM
Landed in 8d5b013 |
Correct requestOnConnect to emit session error on NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE rather than stream error. Add full test suite for the error handling within requestOnConnect. PR-URL: #15080 Refs: #14985 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Correct requestOnConnect to emit session error on NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE rather than stream error. Add full test suite for the error handling within requestOnConnect. PR-URL: nodejs/node#15080 Refs: nodejs/node#14985 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Correct requestOnConnect to emit session error on NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE rather than stream error. Add full test suite for the error handling within requestOnConnect. PR-URL: #15080 Refs: #14985 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Correct requestOnConnect to emit session error on NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE rather than stream error. Add full test suite for the error handling within requestOnConnect. PR-URL: #15080 Refs: #14985 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Correct requestOnConnect to emit session error on NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE rather than stream error. Add full test suite for the error handling within requestOnConnect. PR-URL: #15080 Refs: #14985 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Minor correction in
requestOnConnect
to emit session error onNGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE
rather than stream error. Mostly this is about adding a full test suite for the error handling within requestOnConnect.The test cases are a bit complicated as I felt like it was important to actually test all available errors, in case someone ever goes in and expands the switch statement to handle any other specific errors (or removes one of the currently handled ones). This way it avoids any accidental regressions where errors start emitting somewhere different than expected.
I also have a version of this for
pushStream
that I'll adjust based on feedback here and then create a PR. (It's also emitting stream error onNGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE
.)(I tried to find if there was any convention for mocking functions but it seemed like this is how it was done elsewhere.)
Let me know if there's anything I can adjust. Thanks!
Refs: #14985
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http2, test