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

Deflake Kestrel low response rate tests #13532

Merged
merged 1 commit into from
Aug 29, 2019
Merged

Conversation

halter73
Copy link
Member

@halter73 halter73 commented Aug 29, 2019

After the netcoreapp3.0 to netcoreapp5.0 dependency update yesterday. Kestrel's ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseChunks/Headers tests have become very, very flaky on Linux.

I'm not exactly sure what in the dependency update induced this flakiness (I assume it's some change to System.Net.Sockets), but my guess is that doing a "Connection: close" response where Kestrel disposes the socket immediately after writing the final response body while the client is reading the response at a very low rate is part of the problem leading the connection resets reported by the client.

To fix this, we might want to consider addressing #13219 which would mean waiting for a FIN from the client (with some timeout) before fully closing the socket.

Since the now-flaky tests were intended to verify that Kestrel didn't abort the request because of MinOutputDataRate timeout, I rewrote the tests to use a keep-alive connection instead.

I then added a new test which I pre-marked as flaky on Linux and Helix which verifies that "Connection: close" responses can be read at a low rate.

@halter73 halter73 merged commit 725fa34 into master Aug 29, 2019
@halter73 halter73 deleted the halter73/flaky-close branch August 29, 2019 19:12
@jkotalik
Copy link
Contributor

I'm fairly certain dotnet/corefx#38804 caused this regression. Will follow up with CoreFx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants