Skip to content

[release/10.0] Correct HTTP/2 stream window cap test expectations - #134035

Closed
github-actions[bot] wants to merge 1 commit into
release/10.0from
backport/pr-133942-to-release/10.0
Closed

github-actions[bot] wants to merge 1 commit into
release/10.0from
backport/pr-133942-to-release/10.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #133942 to release/10.0

/cc @rzikm

Customer Impact

  • Customer reported
  • Found internally

[Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.]

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

[How was the fix verified? How was the issue missed previously? What tests were added?]

Risk

[High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]

IMPORTANT: If this backport is for a servicing release, please verify that:

  • For .NET 8 and .NET 9: The PR target branch is release/X.0-staging, not release/X.0.
  • For .NET 10+: The PR target branch is release/X.0 (no -staging suffix).

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Fixes failure in
System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2FlowControl_Test.MaxStreamWindowSize_WhenSet_WindowDoesNotScaleAboveMaximum
observed e.g. in


https://helixr18s23ayyejvk1x8qcc.blob.core.windows.net/dotnet-runtime-refs-heads-main-599d096511a54659b1/System.Net.Http.Functional.Tests/1/console.a3d71edc.log?helixlogtype=result

(no tracking issue yet)

## Summary

Remove the stale expectation in `TestClientWindowScalingAsync` that RTT
PINGs stop once observed stream credit exceeds 90% of its maximum. RTT
estimation belongs to the connection, not an individual stream. The
original implementation explicitly removed this optimization because it
ignored other streams ([author
explanation](#54755 (comment))).
No product PING behavior changes are included.

The current assertion fails in the remote child before `maxCredit <=
MaxWindow` is evaluated; examples include
[Windows](https://helixr18s23ayyejvk1x8qcc.blob.core.windows.net/dotnet-runtime-refs-heads-main-599d096511a54659b1/System.Net.Http.Functional.Tests/1/console.a3d71edc.log?helixlogtype=result)
and
[macOS](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-be1a20d5b78e45c39c/System.Net.Http.Functional.Tests/1/console.7bbcc8f9.log?helixlogtype=result)
in main build 1590723. These failures do not establish a receive-window
overflow.

Retain the existing maximum-credit, payload-length, unexpected-frame and
PING-flood checks. Add a focused theory that sends exactly one update
threshold of nonfinal DATA, stops sending, then checks the target
stream's WINDOW_UPDATE restores credit to exactly 654321. Initial
windows 327161 and 654321 cover one-byte-over-cap doubling and
replenishment at the cap. A zero scaling multiplier removes dependence
on bandwidth; the complete response bytes are also verified.

## Validation

Windows x64, CoreCLR Release and libraries/tests Debug, using a short
`subst` path:

- `build.cmd clr+libs -rc release`: succeeded, zero warnings/errors.
- Full `SocketsHttpHandler_Http2FlowControl_Test` class with
`/p:Outerloop=true`: **11 passed, 0 failed, 0 skipped**, after restoring
all diagnostic changes.
- New exact-credit theory repeated ten times: **20 passed, 0 failed, 0
skipped**.
- Controlled stale-assertion reproduction: temporarily start the
original helper at the cap. The old heuristic fails with the CI child
`Assert.Null` signature; the corrected helper passes the identical
setup. This diagnostic setup is not included in the commit.
- Broken-cap negative control: temporarily remove `Math.Min` and its
adjacent product `Debug.Assert` (so the assertion does not preempt the
test oracle). The new growth case fails with **expected 654321, actual
654322**; the at-cap case passes. Both product changes were restored,
the product rebuilt, and the full class rerun successfully.

Targeted command from the repository root:

```powershell
.\.dotnet\dotnet.exe build src\libraries\System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj /t:Test /p:RuntimeConfiguration=Release /p:Outerloop=true '/p:XUnitOptions=-class System.Net.Http.Functional.Tests.SocketsHttpHandler_Http2FlowControl_Test'
```

The unchanged original test passed once locally; its CI failure is
intermittent. macOS execution and the broader HTTP functional suite were
not run locally. No CI reruns or test disabling were used.

> [!NOTE]
> This PR and its description were generated with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@rzikm

rzikm commented Sep 16, 2026

Copy link
Copy Markdown
Member

Typo, shouldve targeted 11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant