Repository navigation
[Kestrel] Deflake HTTP/2 connection closing tests - #67789
Merged
Merged
Conversation
Wait until the initial request reaches the application before directly initiating graceful shutdown or closing the connection. This guarantees the stream state assumed by each test has been established instead of relying on a transport flush. Failed CI: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1507529&view=ms.vss-test-web.build-test-results-tab&runId=41548186&resultId=110922&paneView=debug Refs #39479 and #41172. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR deflakes three Kestrel in-memory HTTP/2 lifecycle tests by ensuring the first request is actually dispatched to the application before triggering connection shutdown/close paths that depend on active-stream state.
Changes:
- Wrap the test application delegate to signal when a request has entered the app pipeline.
- Await that signal after
StartStreamAsync(...)and before invokingStopProcessingNextRequest(...)/OnInputOrOutputCompleted(). - Make GOAWAY/active-stream expectations deterministic in the affected tests without changing shared scheduling behavior.
Show a summary per file
| File | Description |
|---|---|
| src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs | Adds a per-test “request started” synchronization point to stabilize shutdown/GOAWAY assertions in three HTTP/2 connection closing tests. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
BrennanConroy
approved these changes
Jul 14, 2026
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StartStreamAsyncguarantees that the HEADERS frame was flushed, but not that the connection loop has processed it. A directStopProcessingNextRequestorOnInputOrOutputCompletedcall can therefore observe zero active streams and take a different shutdown path.Tests
The three affected tests passed 100 iterations each (300 executions).
Related