Skip to content

Reduce LargeUriAndHeaders_Works test size on Android to fix timeout flakiness#126010

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-large-uri-timeout-error
Open

Reduce LargeUriAndHeaders_Works test size on Android to fix timeout flakiness#126010
Copilot wants to merge 2 commits intomainfrom
copilot/fix-large-uri-timeout-error

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

SocketsHttpHandler_HttpClientHandlerTest.LargeUriAndHeaders_Works was consistently timing out on Android because the test allocates 10M-character strings for the path, header name, and header value — too large for Android's HTTP stack within the allotted time.

Changes

  • HttpClientHandlerTest.cs: Added Android-specific branch to the length calculation:
int length = IsWinHttpHandler ? 65_000
    : PlatformDetection.IsAndroid ? 100_000
    : 10_000_000;

This mirrors the existing WinHTTP size cap pattern and keeps non-Android platforms at the original 10M limit.

Original prompt

This section details on the original issue you should resolve

<issue_title>[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.LargeUriAndHeaders_Works</issue_title>
<issue_description>```
02-16 16:47:52.072 10194 24326 I DOTNET : [FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.LargeUriAndHeaders_Works
02-16 16:47:52.072 10194 24326 I DOTNET : System.TimeoutException : The operation has timed out.
02-16 16:47:52.072 10194 24326 I DOTNET : at System.Net.Http.Functional.Tests.HttpClientHandlerTest.LargeUriAndHeaders_Works()


## Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1296274
Build error leg or test failing: System.Net.Http.Functional.Tests.WorkItemExecution
Pull request: https://github.com/dotnet/runtime/pull/124387
<!-- Error message template  -->
## Error Message

Fill the error message using [step by step known issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/KnownIssueJsonStepByStep.md).

<!-- Use ErrorMessage for String.Contains matches. Use ErrorPattern for regex matches (single line/no backtracking). Set BuildRetry to `true` to retry builds with this error. Set ExcludeConsoleLog to `true` to skip helix logs analysis. -->

```json
{
  "ErrorMessage": "[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.LargeUriAndHeaders_Works",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1296274
Error message validated: [[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.LargeUriAndHeaders_Works]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 2/25/2026 7:27:26 AM UTC

Report

Build Definition Test Pull Request
1317839 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #124516
1321007 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #124801
1321402 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution
1320129 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #124365
1320101 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #125174
1320034 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.LargeUriAndHeaders_Works #124720
1319961 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution #125146
1319852 dotnet/runtime [System.Net.Http.Functional.Tests.WorkItemExecution](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1319852&view=ms.vss-test-web.build-test-results-tab...

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Fix timeout error in LargeUriAndHeaders test Reduce LargeUriAndHeaders_Works test size on Android to fix timeout flakiness Mar 24, 2026
Copilot AI requested a review from danmoseley March 24, 2026 03:30
@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the LargeUriAndHeaders_Works functional test to avoid Android timeouts by reducing the size of the generated URI path and header strings on Android, while preserving the existing stress level on other platforms and the WinHTTP-specific cap.

Changes:

  • Add an Android-specific length cap for the test data to reduce runtime/memory pressure on Android.
  • Keep the existing WinHTTP cap (65,000) and the existing non-Android/non-WinHTTP size (10,000,000).

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.

[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.LargeUriAndHeaders_Works

4 participants