diff --git a/src/crypto/ed25519/ed25519_test.go b/src/crypto/ed25519/ed25519_test.go index ba9970e23e5..8a973b36eaf 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 ac7c78c0867..8031256525a 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())