TestPackedScanKeepsItsDecoder went red on macOS CI at 3a213e1dc, a
CSS-only commit: 665,955 bytes against a 512 KiB bar. allocated()
averaged runtime.MemStats.TotalAlloc over its calls, and TotalAlloc
counts every goroutine in the process, so another test's leftover work
was billed to the scan. It now returns the least any one call
allocated. A decoder made anew costs its window on every call (about
3 MiB for a packed rollout), so the least still shows it; work that
overlaps one call no longer does. TestDshFramesKeepTheirDecoder shares
the helper and gets the same fix.
Run at 8c68b6802 (origin/main), internal/sessions only (test-only change):
- Injected noise (a goroutine allocating 256 KiB every 8 ms): old
helper red 3 of 4 runs, new helper green 4 of 4. Two forced
runtime.GC() calls between scans leave the old helper green, so the
pool being emptied is not the cause.
- Broken by hand: openLines making a new decoder each read turns
TestPackedScanKeepsItsDecoder red (3,330,376 bytes); frameDecoders.New
in place of Get turns TestDshFramesKeepTheirDecoder red (165,512).
- go test ./internal/sessions/ ok; the two tests -count=10 ok; gofmt
clean; vet darwin, linux (-tags nogui), windows ok.
Not run: the full suite. Nothing outside this test file changes.