diff options
author | Filippo Valsorda <filippo@golang.org> | 2021-05-05 21:32:04 -0400 |
---|---|---|
committer | Filippo Valsorda <filippo@golang.org> | 2021-05-06 02:20:28 +0000 |
commit | 43c390a1fabfa5eb81529f399bb4d1875f1ca35d (patch) | |
tree | 06bc0dea021113744f533cb54328e7faa5e10377 /src/crypto | |
parent | cf73f1a8e40f44c0d3c69d63a5815861d685a845 (diff) | |
download | go-43c390a1fabfa5eb81529f399bb4d1875f1ca35d.tar.gz go-43c390a1fabfa5eb81529f399bb4d1875f1ca35d.zip |
crypto/ed25519: skip allocations test on -noopt builder
Without optimizations, there will be unexpected allocations.
Change-Id: I90dc2636279b7fda7689eabc763251c4cdd25874
Reviewed-on: https://go-review.googlesource.com/c/go/+/317370
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Diffstat (limited to 'src/crypto')
-rw-r--r-- | src/crypto/ed25519/ed25519_test.go | 3 | ||||
-rw-r--r-- | src/crypto/ed25519/internal/edwards25519/edwards25519_test.go | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/crypto/ed25519/ed25519_test.go b/src/crypto/ed25519/ed25519_test.go index ba9970e23e..8a973b36ea 100644 --- a/src/crypto/ed25519/ed25519_test.go +++ b/src/crypto/ed25519/ed25519_test.go @@ -186,6 +186,9 @@ func TestMalleability(t *testing.T) { } func TestAllocations(t *testing.T) { + if strings.HasSuffix(os.Getenv("GO_BUILDER_NAME"), "-noopt") { + t.Skip("skipping allocations test without relevant optimizations") + } if allocs := testing.AllocsPerRun(100, func() { seed := make([]byte, SeedSize) message := []byte("Hello, world!") diff --git a/src/crypto/ed25519/internal/edwards25519/edwards25519_test.go b/src/crypto/ed25519/internal/edwards25519/edwards25519_test.go index ac7c78c086..8031256525 100644 --- a/src/crypto/ed25519/internal/edwards25519/edwards25519_test.go +++ b/src/crypto/ed25519/internal/edwards25519/edwards25519_test.go @@ -7,7 +7,9 @@ package edwards25519 import ( "crypto/ed25519/internal/edwards25519/field" "encoding/hex" + "os" "reflect" + "strings" "testing" ) @@ -279,6 +281,9 @@ func TestNonCanonicalPoints(t *testing.T) { var testAllocationsSink byte func TestAllocations(t *testing.T) { + if strings.HasSuffix(os.Getenv("GO_BUILDER_NAME"), "-noopt") { + t.Skip("skipping allocations test without relevant optimizations") + } if allocs := testing.AllocsPerRun(100, func() { p := NewIdentityPoint() p.Add(p, NewGeneratorPoint()) |