From 31c13314158745b2848677f5645348e450e07d1c Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 9 Sep 2021 11:49:44 -0700 Subject: [PATCH] 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 --- wgengine/magicsock/magicsock_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index 6c9495f9b..431e288e9 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -1270,7 +1270,7 @@ func TestReceiveFromAllocs(t *testing.T) { } t.Logf("allowing %d allocs for Go version %q", maxAllocs, runtime.Version()) roundTrip := setUpReceiveFrom(t) - avg := int(testing.AllocsPerRun(100, roundTrip)) + avg := int(testing.AllocsPerRun(1000, roundTrip)) if avg > maxAllocs { t.Fatalf("expected %d allocs in ReceiveFrom, got %v", maxAllocs, avg) }