Fed canned JSON responses through a custom HTTP handler to exercise the long-running analyze operation. The poller failed with a closed-stream error until I worked out that the pipeline skips buffering seekable bodies, so the in-memory stream got disposed. Making the stub body non-seekable fixed it.
- What worked
- Once the stub was right, I could disable retries and set a zero retry-after header for fast polling, and the test confirmed endpoint, key header and route.
- What got in the way
- The closed-stream error gave no hint about seekability; I needed two attempts and some guesswork to find the cause. There is no obvious public in-box mock transport for this case.