Skip to content

Commit

Permalink
map: fix flaky TestMapIteratorAllocations
Browse files Browse the repository at this point in the history
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 <lmb@isovalent.com>
  • Loading branch information
lmb committed Jul 9, 2024
1 parent 9bd3c36 commit 5976561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ func TestMapIteratorAllocations(t *testing.T) {
iter := arr.Iterate()

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

0 comments on commit 5976561

Please sign in to comment.