]> Cypherpunks repositories - gostls13.git/commitdiff
net: use testenv.SkipIfOptimizationOff in TestAllocs
authorTobias Klauser <tklauser@distanz.ch>
Mon, 15 Aug 2022 09:13:06 +0000 (11:13 +0200)
committerDamien Neil <dneil@google.com>
Mon, 15 Aug 2022 18:44:19 +0000 (18:44 +0000)
Use the helper added by CL 422038 instead of manually detecting the
noopt builder.

Change-Id: I353f1a9d5f0184d73869520eb1ae8d0bdbbe2006
Reviewed-on: https://go-review.googlesource.com/c/go/+/423855
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/net/udpsock_test.go

index 4ceacde10e43f8e5ce3cd7b2c56ea189b825602b..0ed2ff98c1a2c87f7e441bb20724eb43fd7046a6 100644 (file)
@@ -464,12 +464,9 @@ func TestAllocs(t *testing.T) {
                // 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)
-       }
+       // Optimizations are required to remove the allocs.
+       testenv.SkipIfOptimizationOff(t)
+
        conn, err := ListenUDP("udp4", &UDPAddr{IP: IPv4(127, 0, 0, 1)})
        if err != nil {
                t.Fatal(err)