mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 08:07:42 +00:00
wgengine/magicsock: deflake TestReceiveFromAllocs
100 iterations isn't enough with background allocs happening apparently. 1000 seems to be reliable. Fixes #2826 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
a353fbd3b4
commit
31c1331415
@ -1270,7 +1270,7 @@ func TestReceiveFromAllocs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
t.Logf("allowing %d allocs for Go version %q", maxAllocs, runtime.Version())
|
t.Logf("allowing %d allocs for Go version %q", maxAllocs, runtime.Version())
|
||||||
roundTrip := setUpReceiveFrom(t)
|
roundTrip := setUpReceiveFrom(t)
|
||||||
avg := int(testing.AllocsPerRun(100, roundTrip))
|
avg := int(testing.AllocsPerRun(1000, roundTrip))
|
||||||
if avg > maxAllocs {
|
if avg > maxAllocs {
|
||||||
t.Fatalf("expected %d allocs in ReceiveFrom, got %v", maxAllocs, avg)
|
t.Fatalf("expected %d allocs in ReceiveFrom, got %v", maxAllocs, avg)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user