Skip to content

Fix weak reference Kestrel test#67403

Merged
wtgodbe merged 2 commits into
mainfrom
BrennanConroy-patch-3
Jun 29, 2026
Merged

Fix weak reference Kestrel test#67403
wtgodbe merged 2 commits into
mainfrom
BrennanConroy-patch-3

Conversation

@BrennanConroy

Copy link
Copy Markdown
Member

See dotnet/runtime#129157 for some context.

@BrennanConroy BrennanConroy requested a review from wtgodbe June 24, 2026 20:58
@BrennanConroy BrennanConroy requested a review from halter73 as a code owner June 24, 2026 20:58
Copilot AI review requested due to automatic review settings June 24, 2026 20:58
@BrennanConroy BrennanConroy added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates a quarantined Kestrel in-memory functional test to avoid accidentally rooting the HttpConnection on the test method’s async state machine, which could prevent it from being garbage collected and make the test unreliable.

Changes:

  • Refactors connection creation/request send into a separate helper method to ensure the connection can be collected after disposal.
  • Marks the helper method as non-inlinable and adds the required System.Runtime.CompilerServices import.
Show a summary per file
File Description
src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpConnectionManagerTests.cs Moves connection setup into a [MethodImpl(NoInlining)] helper to prevent GC rooting and stabilize the weak-reference-style test behavior.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@wtgodbe wtgodbe merged commit 59d3bac into main Jun 29, 2026
25 checks passed
@wtgodbe wtgodbe deleted the BrennanConroy-patch-3 branch June 29, 2026 23:57
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.

3 participants