Files
magpie/internal
yetone d3f3f33811 gateway tests: TestMarshalBodyAllocatesTwoBodies skips under -race, where sync.Pool lets go
0b99b8fbe (#4004) added a bound of 2.5x the body on what marshalBody
allocates. Under -race, sync.Pool drops a quarter of what is put in it,
so json.Marshal's encodeState isn't reused across marshalItems' items
and each one allocates afresh. CI's Race job on macOS went red at
25df3187b ("marshalBody allocated 184 MiB for a 47 MiB body, want at
most 2.5x"), the first Test run after 0b99b8fbe that wasn't cancelled.
The test now skips under raceOn, as parse_memo_test.go's two pool
bounds already do (race_on_test.go).

Run on mote at origin/main df9376592:
- before: go test -race -run TestMarshalBody ./internal/gateway: FAIL,
  176 MiB for 47 MiB.
- after: the same, ok (AllocatesTwoBodies SKIP, IsJSONMarshal PASS);
  without -race: ok, marshalBody 98 MiB for 47 MiB (bound 117), against
  json.Marshal's 205 MiB, so the bound still fails if marshalBody
  falls back to json.Marshal's growth. go vet ./internal/gateway ok,
  gofmt clean.
Not run: the full suite (test file only, one test).
2026-10-28 18:58:14 +08:00
..
…
…
…