Skip to content

Commit 2163a58

Browse files
qmuntalgopherbot
authored andcommitted
crypto/internal/fips140/entropy: increase AllocsPerRun iterations
TestNISTECAllocations is flaky (~1% failure rate) on my local Windows machine since CL 710058, which touched TestEntropyRace. These tests are unrelated, but some allocations might be incorrectly accounted to TestNISTECAllocations, affecting the end result due to the low number of iterations done in that test. Change-Id: I01323c2a45b12665e86d940467f4f91c2e66696b Reviewed-on: https://go-review.googlesource.com/c/go/+/712620 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Quim Muntal <quimmuntal@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 306eacb commit 2163a58

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/crypto/internal/fips140test/nistec_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
func TestNISTECAllocations(t *testing.T) {
1919
cryptotest.SkipTestAllocations(t)
2020
t.Run("P224", func(t *testing.T) {
21-
if allocs := testing.AllocsPerRun(10, func() {
21+
if allocs := testing.AllocsPerRun(100, func() {
2222
p := nistec.NewP224Point().SetGenerator()
2323
scalar := make([]byte, 28)
2424
rand.Read(scalar)
@@ -37,7 +37,7 @@ func TestNISTECAllocations(t *testing.T) {
3737
}
3838
})
3939
t.Run("P256", func(t *testing.T) {
40-
if allocs := testing.AllocsPerRun(10, func() {
40+
if allocs := testing.AllocsPerRun(100, func() {
4141
p := nistec.NewP256Point().SetGenerator()
4242
scalar := make([]byte, 32)
4343
rand.Read(scalar)
@@ -56,7 +56,7 @@ func TestNISTECAllocations(t *testing.T) {
5656
}
5757
})
5858
t.Run("P384", func(t *testing.T) {
59-
if allocs := testing.AllocsPerRun(10, func() {
59+
if allocs := testing.AllocsPerRun(100, func() {
6060
p := nistec.NewP384Point().SetGenerator()
6161
scalar := make([]byte, 48)
6262
rand.Read(scalar)
@@ -75,7 +75,7 @@ func TestNISTECAllocations(t *testing.T) {
7575
}
7676
})
7777
t.Run("P521", func(t *testing.T) {
78-
if allocs := testing.AllocsPerRun(10, func() {
78+
if allocs := testing.AllocsPerRun(100, func() {
7979
p := nistec.NewP521Point().SetGenerator()
8080
scalar := make([]byte, 66)
8181
rand.Read(scalar)

src/crypto/internal/fips140test/xaes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func TestXAESAllocations(t *testing.T) {
2121
t.Skip("Test reports non-zero allocation count. See issue #70448")
2222
}
2323
cryptotest.SkipTestAllocations(t)
24-
if allocs := testing.AllocsPerRun(10, func() {
24+
if allocs := testing.AllocsPerRun(100, func() {
2525
key := make([]byte, 32)
2626
nonce := make([]byte, 24)
2727
plaintext := make([]byte, 16)

0 commit comments

Comments
 (0)