Repository navigation
Fix Flaky HTTP/3 Test: POST_ClientCancellationUpload_RequestAbortRaised - #68111
Conversation
|
Thanks for your PR, @PreethikaSelvam. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
POST_ClientCancellationUpload_RequestAbortRaisedPOST_ClientCancellationUpload_RequestAbortRaised
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the flaky HTTP/3 interop functional test Http3RequestTests.POST_ClientCancellationUpload_RequestAbortRaised by accounting for timing-dependent transport behavior after client cancellation. It keeps the existing validation that server-side RequestAborted is observed, while removing the assumption that a post-cancellation body read must always surface as an exception.
Changes:
- Adjusts the test to accept either a post-cancellation
ReadAsync()throwingIOException("The client reset the request stream.")or completing with0bytes (EOF). - Updates the
TaskCompletionSourcetype toTaskCompletionSource<Task<int>>to correctly modelReadAsync()’s return type and enable validating the byte count. - Preserves the existing cancellation signaling/ordering (server observes
RequestAbortedbefore evaluating the final read result).
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
POST_ClientCancellationUpload_RequestAbortRaisedPOST_ClientCancellationUpload_RequestAbortRaised
|
Thanks for your contribution. This is not Blazor related area, so let's close this PR and align on the effort. |
Summary
Fixes intermittent failures in Http3RequestTests.POST_ClientCancellationUpload_RequestAbortRaised caused by timing-dependent behavior when reading the request body after client cancellation in HTTP/3.
Validation / Investigation
The failing test intermittently reported:
Assert.Throws() Failure: No exception was thrown Expected: typeof(System.IO.IOException)To investigate the issue, the test was executed in a local stress run of 1000 iterations, during which the failure was successfully reproduced. Analysis of both local and CI failures confirmed that:
The flakiness was caused by the final request body read after cancellation. Depending on timing, two valid outcomes were observed:
ReadAsync() throws:
IOException("The client reset the request stream.")ReadAsync() completes successfully and returns:
0indicating EOF.
The existing test only accepted the exception path, causing intermittent failures whenever EOF was observed instead.
Validation
Changes
Fixes #67518 & #58802