From 5ff0b531748fcdc88d6667e55e021fe02e0c0089 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Fri, 26 Apr 2024 09:38:44 +0200 Subject: [PATCH] bytes: skip TestNewBufferShallow if optimization is disabled TestNewBufferShallow should be skipped if optimization is disabled. It is currently failing on no-opt builders. Change-Id: Ib5e62022a56a4e5f158f247d69a6229d2cb4d99e Reviewed-on: https://go-review.googlesource.com/c/go/+/581915 Auto-Submit: Than McIntosh Reviewed-by: Than McIntosh Auto-Submit: Quim Muntal LUCI-TryBot-Result: Go LUCI Reviewed-by: Joedian Reid --- src/bytes/buffer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bytes/buffer_test.go b/src/bytes/buffer_test.go index 322e7367c7..3c964fc6b9 100644 --- a/src/bytes/buffer_test.go +++ b/src/bytes/buffer_test.go @@ -7,6 +7,7 @@ package bytes_test import ( . "bytes" "fmt" + "internal/testenv" "io" "math/rand" "strconv" @@ -100,6 +101,7 @@ var buf Buffer // should not result in any allocations. // This can be used to reset the underlying []byte of an existing Buffer. func TestNewBufferShallow(t *testing.T) { + testenv.SkipIfOptimizationOff(t) n := testing.AllocsPerRun(1000, func() { buf = *NewBuffer(testBytes) })