You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP Cancellation tests should validate cancellation on the wire #58238
We have a bunch of cancellation tests in HttpClientHandlerTest.Cancellation.cs that validate that requests can be cancelled on the client. But none of these are actually validating that the server is properly notified of the cancellation, via the HTTP version specific mechanism (like RST_STREAM for HTTP2).
The loopback server WaitForCancellationAsync method was added to do exactly this -- validate that the server sees the client's cancellation. But currently none of these tests use it. We should modify these tests to use it, which should both (a) simplify some of the test logic (hopefully) and (b) validate that we are cancelling properly on the wire in all cases.
(The only case in which we use WaitForCancellationAsync is in a request finalization test, which sort of makes sense since the only way to actually verify finalization is to observe the behavior on the wire.)
Note that WinHttpHandler seems to aggressively send RST on request cancellation for HTTP/1.1, so we will need to modify the HTTP/1.1 implementation of WaitForCancellationAsync to allow RST.
Activity
karelz commentedon Jul 21, 2022
Triage: Test enhancement, not critical for 7.0 -- moving to Future.