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
Consume connections better in socket-level tests #1958
Conversation
df489bd
to
bfd1215
Compare
Codecov Report
@@ Coverage Diff @@
## master #1958 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 2187 2187
=========================================
Hits 2187 2187 Continue to review full report at Codecov.
|
@hodbn I merged master into your branch, since it was a prerequisite before merging this anyway |
This looks like black magic to me, but is great if it works! Would like to have another pair of eyes before I merge it |
63d8bb7
to
0482c6e
Compare
I've added another sentence of docs, hopefully the class purpose is more clear now. |
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.
Let's try that! Thanks.
I'm guessing this is the change that makes the CI flaky? At least the MacOS tests failed 2/2 times, and first it was the 3.8, then the 3.6 test, and different ones, with the only common thing being that they were both socket-related (Connection Refused). |
I don't think these failures are related to this change. |
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
Add a utility that allows better timing of test responses, instead of socket consuming.
In Windows, after the second operation on a remotely closed socket a
WSAECONNABORTED
is raised.In our socket-level tests, we implement a dummy HTTP server that only consumes data from the client socket, therefore it can't know when to stop consuming and might close the socket too early. This might cause unnecessary
send/recv
s on the already closed socket, which in turn will raiseWSAECONNABORTED
when it could be avoided.I've added the 2 tests that are currently skipped on Windows (since #1951).
This change should prevent
WSAECONNABORTED
when testing the aforementioned tests on Windows.