From a0d661ab0ff896abe45d6d4e79cb71df233c5319 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 5 Nov 2021 08:18:57 -0700 Subject: [PATCH] net: skip new alloc test on some builders Change-Id: Ib785212eb9e035a10d327696c180caf730d2e5e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/361634 Run-TryBot: Brad Fitzpatrick TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills Trust: Brad Fitzpatrick --- src/net/udpsock_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/net/udpsock_test.go b/src/net/udpsock_test.go index 518c66c331..9fe74f47a2 100644 --- a/src/net/udpsock_test.go +++ b/src/net/udpsock_test.go @@ -475,6 +475,17 @@ func TestUDPReadTimeout(t *testing.T) { } func TestAllocs(t *testing.T) { + switch runtime.GOOS { + case "plan9": + // Plan9 wasn't optimized. + t.Skipf("skipping on %v", runtime.GOOS) + } + builder := os.Getenv("GO_BUILDER_NAME") + switch builder { + case "linux-amd64-noopt": + // Optimizations are required to remove the allocs. + t.Skipf("skipping on %v", builder) + } conn, err := ListenUDP("udp4", &UDPAddr{IP: IPv4(127, 0, 0, 1)}) if err != nil { t.Fatal(err)