]> Cypherpunks repositories - gostls13.git/commitdiff
hash/maphash: weaken avalanche test a bit more
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 31 Oct 2023 11:34:42 +0000 (18:34 +0700)
committerGopher Robot <gobot@golang.org>
Tue, 31 Oct 2023 17:00:31 +0000 (17:00 +0000)
CL 495415 weaken avalanche, making allowed range from 43% to 57%. Since
then, we only see a failure with 58% on linux-386-longtest builder, so
let give the test a bit more wiggle room: 40% to 59%.

Fixes #60170

Change-Id: I9528ebc8601975b733c3d9fd464ce41429654273
Reviewed-on: https://go-review.googlesource.com/c/go/+/538655
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>

src/hash/maphash/smhasher_test.go
src/runtime/hash_test.go

index a6e8a21e57d4c994e5f12ef0f9ef33b65e657e55..085036bd7b3d65fd11db48453b6ad0016de8bcf3 100644 (file)
@@ -381,7 +381,7 @@ func avalancheTest1(t *testing.T, k key) {
        // find c such that Prob(mean-c*stddev < x < mean+c*stddev)^N > .9999
        for c = 0.0; math.Pow(math.Erf(c/math.Sqrt(2)), float64(N)) < .9999; c += .1 {
        }
-       c *= 8.0 // allowed slack - we don't need to be perfectly random
+       c *= 11.0 // allowed slack: 40% to 60% - we don't need to be perfectly random
        mean := .5 * REP
        stddev := .5 * math.Sqrt(REP)
        low := int(mean - c*stddev)
index 65628298251c5aec282dd58e60e61f0a6b7790ed..c1d4bfa0806f434a38a28f1a021e940c04714b60 100644 (file)
@@ -513,7 +513,7 @@ func avalancheTest1(t *testing.T, k Key) {
        // find c such that Prob(mean-c*stddev < x < mean+c*stddev)^N > .9999
        for c = 0.0; math.Pow(math.Erf(c/math.Sqrt(2)), float64(N)) < .9999; c += .1 {
        }
-       c *= 8.0 // allowed slack - we don't need to be perfectly random
+       c *= 11.0 // allowed slack: 40% to 60% - we don't need to be perfectly random
        mean := .5 * REP
        stddev := .5 * math.Sqrt(REP)
        low := int(mean - c*stddev)