]> Cypherpunks repositories - gostls13.git/commitdiff
bytes: skip TestNewBufferShallow if optimization is disabled
authorqmuntal <quimmuntal@gmail.com>
Fri, 26 Apr 2024 07:38:44 +0000 (09:38 +0200)
committerGopher Robot <gobot@golang.org>
Fri, 26 Apr 2024 13:31:36 +0000 (13:31 +0000)
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 <thanm@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joedian Reid <joedian@google.com>
src/bytes/buffer_test.go

index 322e7367c768115464f69f3e9c3c6092d394a914..3c964fc6b990bbbb86d0c638291053873a9f3458 100644 (file)
@@ -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)
        })