-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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-upgrade-agent
flakiness
#4520
Conversation
This PR only has a change to the test. Is this sentence in error or is there a missing modified file that needs to be added? |
8b6e674
to
c595680
Compare
Yes, that sentence was wrong. I rewrote the commit message. PTAL |
The changes to the upgrade event handler looks good to me. I don't think we need the |
c595680
to
8ac8915
Compare
@Trott PR updated with your comments. Thanks |
LGTM if CI is happy. CI: https://ci.nodejs.org/job/node-test-commit/1664/ We need to get you onboarded so you can start these CI jobs yourself! Minor nit that can be ignored if you want: I don't think we need the |
One other comment that you can ignore if you want: The same issue you're fixing here seems to afflict |
8ac8915
to
d710d9c
Compare
@Trott I've removed the |
Looks like the modified test fails (or is flaky?) on FreeBSD and Raspberry Pi: |
@Trott It seems the CI was started with the previous version of the PR: 8ac8915 (the one with |
Nah, increasing the timeout won't work either as the client is closing the connection when it receives the upgrade request. I think I'm removing the test altogether as it may happen that the second write could fail due to a race condition with the client closing the connection. |
d710d9c
to
2368c95
Compare
PR updated. I think this should work |
One nit, but LGTM if CI doesn't uncover anything. |
recvData += d; | ||
}); | ||
|
||
socket.on('close', function() { |
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: As mscdex noted in the other PR that's similar to this, this callback might benefit from being wrapped in common.mustCall()
to guarantee that it fires.
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received.
2368c95
to
6e84dda
Compare
PR updated. Thanks |
LGTM |
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received. PR-URL: #4520 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 6018fa1 |
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received. PR-URL: #4520 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received. PR-URL: #4520 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received. PR-URL: #4520 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received. PR-URL: nodejs#4520 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received. PR-URL: nodejs#4520 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not guaranteed that the socket data is received in the same chunk as the upgrade response. Listen for the `data` event to make sure all the data is received. PR-URL: nodejs#4520 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
It's not guaranteed that the socket data is received in the same chunk
as the upgrade response. Listen for the
data
event to make sure allthe data is received. Modify the test so it does not pass without
applying this change.
I was getting this error from time to time on
OS X
: