Skip to content

Commit 5976561

Browse files
committed
map: fix flaky TestMapIteratorAllocations
For some reason the allocation check is flaky, with an allocation happening in sysenc.Unmarshal. Pinpointing the exact cause is difficult because we can't tell whether the allocation happened during the warm up or not. Increase the number of runs for the allocation check, which is probably a sensible thing to do anyways. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent 9bd3c36 commit 5976561

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

map_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ func TestMapIteratorAllocations(t *testing.T) {
11061106
iter := arr.Iterate()
11071107

11081108
// AllocsPerRun warms up the function for us.
1109-
allocs := testing.AllocsPerRun(1, func() {
1109+
allocs := testing.AllocsPerRun(int(arr.MaxEntries()-1), func() {
11101110
if !iter.Next(&k, &v) {
11111111
t.Fatal("Next failed")
11121112
}

0 commit comments

Comments
 (0)