-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix flakey HTTP/2 tests #39588
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
Fix flakey HTTP/2 tests #39588
Conversation
Could I get a review? 🙏 I'd like to merge this to stop any more flakey tests from popping up from this issue. |
Could you explain how this fixes the issue? |
I talked with @halter73 when he made this change. I believe awaiting The problem that this PR fixes is Correct me if I'm wrong @halter73 😄 |
Awaiting It's different than |
This PR definitely fixes the flakey test. Before 5000 executions would result in 30ish failures. After 5000 executions all pass. Not having |
I was wrong with my last comment. Task captures the ExecutionContext when it's constructed so it uses that ExecutionContext rather than the ExecutionContext of the thread it's completed on (thankfully thinking about this more). This makes me want to return a ConfiguredTaskAwaitable from InitializeConnectionAsync so the entire tests run without the sync context like I thought was happening before, but it doesn't have to be this PR. E.g. protected ConfiguredTaskAwaitable InitializeConnectionAsync(RequestDelegate application, int expectedSettingsCount = 3, bool expectedWindowUpdate = true)
{
return InitializeConnectionInnerAsync(application, expectedSettingsCount, expectedWindowUpdate).DefaultTimeout().ConfigureAwait(false);
} |
Addresses #39520