00d75828
mcphttp: test Unwrap for what it actually carries
The comment claimed Unwrap was what kept streaming alive, and the test named after that claim passed with the method deleted. Both were wrong, and wrong for the same reason: cacheWriter has its own Flush, and http.NewResponseController prefers a method on the writer it is handed over one reached by unwrapping, so the flush path never unwraps at all. What Unwrap does carry is everything else the controller offers — the deadlines and Hijack. A long-lived MCP stream is the response that wants its write deadline pushed out. The new test measures that against a real server, because a recorder supports no deadlines either way and would have been vacuous a second time. Found by an independent reviewer that mutated the method away instead of reading the comment.
Eugene Blikh <bigbes@gmail.com> — 2026-08-16 04:59:18 UTC
Commit 00d758288173ba73e6c117516c4d3828769667ba —
view raw patch
Parent(s):
b352133b
| File | Status | + | − |
|---|---|---|---|
mcphttp/cache.go
|
M | +13 | -7 |
mcphttp/cache_test.go
|
M | +39 | -8 |