test: assert stream cancellation reaches transport - #151
Conversation
|
This makes the assertion load-bearing. I mutation-tested it rather than assuming. I shielded the transport read from consumer cancellation inside That is exactly the property worth pinning, and it was not pinned before: the old One small thing, not a blocker. Dropping the If you want the name to hold, capturing the request and asserting after the |
Sayan-
left a comment
There was a problem hiding this comment.
Verified: the new assertion catches a shielded-cancellation regression, so it is genuinely load-bearing now. One optional note above about the dropped path assertion.
|
addressed in |
|
Re-reviewed after Re-verified on the new head:
Nothing else changed, so my earlier note is resolved by the rename rather than by adding a path assertion, which is fine given |
Summary
Follow-up to #148.
Tests
Note
Low Risk
Test-only change to async telemetry cancellation coverage; no production or routing logic modified.
Overview
Renames
test_async_telemetry_stream_cancellation_survives_direct_routingtotest_async_telemetry_stream_cancellation_reaches_transportand tightens what cancellation must prove for direct-routed async telemetry SSE.The mock
BlockingSSEStreamnow blocks on a chunk queue and recordsasyncio.CancelledErrorin__aiter__instead of waiting on an eternal event and signaling stop viafinally/aclose. The test waits ontransport_cancelledafter cancelling the consumer task, so passing means cancel propagates into the httpx transport byte stream—not merely that the asyncio task was cancelled.The mock handler drops the redundant path assertion (routing is covered elsewhere), and removes the unreachable trailing
yieldafter an infinite wait.Reviewed by Cursor Bugbot for commit d281b8f. Bugbot is set up for automated code reviews on this repo. Configure here.