Files
magpie/internal
yetone c3ba2cc933 gateway: TestUnroutedProgressingUploadOutlastsMost gives the handler's time between reads room (#5274)
The zstd subtest went red on macOS CI at 4a9cfb52e: "held 1s before
routing, its body still arriving (256.1 KB of 256.1 KB, the last 100ms
ago); in body 500ms; stopped with 408". Only time spent in a wire read
(waitedBody.Read) earns upload credit; the handler's own time between
reads (decoding, being scheduled again) counts toward unroutedMost. On
mote that time is under 2ms, but a loaded runner spent about 1s of it,
past the test's 1s unroutedMost, so the hold stopped the upload with 408.

The test now holds most at 3s and waits most+most/2 for the hold to end
by itself, well under the 6s (gzip) to 8s the wire bytes earn. The
production rule is unchanged: a stalled handler is still not an upload.

Run on mote (macOS) at this tree:
- Injected one 1.2s stall after the first wire read, outside the body
  wait: old test red on all 4 subtests ("in body 0s", 408); new test
  green on all 4.
- Injected 3.5s: new test red on all 4, so the bound is where the
  comment says.
- Credit broken by hand (earned := 0): new test red on all 4.
- No injection: green, ~4.5s a subtest.
- go test -race -count=2 -run '^TestUnrouted' ./internal/gateway: ok
  (65.8s). gofmt -l and go vet ./internal/gateway: clean.
Not tried: Linux or Windows runs (the test has no OS branch); the full
suite (run once after this batch).
2026-11-05 01:20:51 +08:00
..
…
…
…
…
…
…
…
…