What changed: the fake relays in TestStalledAnswerSaysUrlOrB64 and
TestVendorThatStopsMidAnswerIsSaid waited on r.Context().Done() with a
time.After(5 * time.Second) fallback of their own. Under load the fake's
5s could end its answer before the gateway's 500ms stall deadline
(drawUnit = 100ms) was acted on, so the gateway read a cut body and said
502 "isn't an images API's: unexpected end of JSON input" instead of the
stall's 504 (#4245). The fakes now wait on the context alone: the
deadline's cancel is what ends them, so the order can't flip. No product
behavior changes; both tests still assert the same 504 wording.
Run: go test ./internal/gateway -run
'TestStalledAnswerSaysUrlOrB64|TestVendorThatStopsMidAnswerIsSaid'
-count=5 - ok.
go test -tags nogui -timeout 45m ./internal/gateway/... - ok (500s).
go vet ./... and GOOS=windows go vet ./... - ok; GOOS=linux go vet ./...
fails in wails (undefined: pointer) at the base commit too.
CGO_ENABLED=0 GOOS=linux|windows|darwin go build -tags nogui . - ok.
Generated-by: GLM-5.3-Flash (ZCode)