Fix hang in InvalidClientRequestTests by guarding oversized Content-Length cases to managed implementation - #132321
Draft
alinpahontu2912 wants to merge 1 commit into
Conversation
InvalidRequest_TestData fed two new POST cases with Content-Length values above long.MaxValue directly into GetContext_InvalidRequest_DoesNotGetContext, which also runs against the native http.sys-backed HttpListenerRequest.Windows.cs on Windows. http.sys does not reject these oversized values the same way the managed parser (HttpListenerRequest.Managed.cs) now does, so the server never completes the request and the test hangs until the Helix executor timeout kills the work item. Wrap the two new test cases in an 'if (Helpers.IsManagedImplementation)' guard, matching the existing pattern used elsewhere in this file, so they only run against the managed implementation whose behavior they were written to verify. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bcc5e304-cc27-44b0-aac3-b9eada42d13f
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates InvalidClientRequestTests to avoid Helix timeouts/hangs on Windows by ensuring the oversized Content-Length rejection cases only run against the managed HttpListener implementation (where that behavior is expected and validated).
Changes:
- Guard the two oversized
Content-Lengthtest vectors (e.g.,long.MaxValue + 1,ulong.MaxValue) behindHelpers.IsManagedImplementation. - Prevent these cases from running on the Windows
http.sys-backed implementation, which can otherwise wait for an (effectively) unbounded request body and hang the test.
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.
Two new InvalidClientRequestTests cases test oversized Content-Length rejection, but run against Windows' native http.sys path too, which doesn't reject them the same way — causing a hang until Helix's timeout. Guards them with Helpers.IsManagedImplementation so they only run against the managed parser they're meant to test.