Repository navigation
[wasi] Fix flaky PostAsync_CancelDuringRequestContentSend_TaskCanceledQuickly with WasiHttpHandler - #137535
Merged
Conversation
With WasiHttpHandler the wasi:http host can abandon a canceled request before it connects to the loopback server, leaving AcceptConnectionAsync waiting until the loopback timeout. Let the server side complete once the client is done, as the other request-content tests already do for WasiHttpHandler. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 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 |
steveisok
approved these changes
Nov 14, 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.
PostAsync_CancelDuringRequestContentSend_TaskCanceledQuicklyintermittently times out inSystem.Net.Http.WasiHttpHandler.Functional.Testson WASI (#137534).The failure is the loopback harness's 60s
TimeoutException, not the cancellation assertion. When the request is canceled while its body is being sent, the wasi:http host can abandon the request before it connects to the loopback server. The server side then waits inAcceptConnectionAsyncuntil the harness times out.For WasiHttpHandler, the server side now completes once the client side is done, the same way
SendAsync_Expect100Continue_RequestBodyFails_ThrowsContentExceptionandPostAsync_Cancel_CancellationTokenPassedToContentalready handle this race. Other handlers are unchanged.Validation
WasiHttpHandler_HttpClientHandler_Cancellation_Testpassed 5 of 5 runs (43/43 each). The race didn't reproduce locally, so this confirms no regression rather than reproducing the fix.System.Net.Http.Functional.Testsbuilds for WASI with the change.Resolves #137534
Note
This PR description and the change were generated with GitHub Copilot.