diff --git a/src/crypto/rand/rand_test.go b/src/crypto/rand/rand_test.go index 0743a2dd04..2372413279 100644 --- a/src/crypto/rand/rand_test.go +++ b/src/crypto/rand/rand_test.go @@ -158,6 +158,7 @@ func TestAllocations(t *testing.T) { if race.Enabled { t.Skip("urandomRead allocates under -race") } + testenv.SkipIfOptimizationOff(t) n := int(testing.AllocsPerRun(10, func() { buf := make([]byte, 32)