From: Cuong Manh Le Date: Tue, 31 Oct 2023 11:34:42 +0000 (+0700) Subject: hash/maphash: weaken avalanche test a bit more X-Git-Tag: go1.22rc1~478 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3dea7c3f690cb35858b122605d1f029df8062293;p=gostls13.git hash/maphash: weaken avalanche test a bit more 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 Reviewed-by: Bryan Mills LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Auto-Submit: Cuong Manh Le --- diff --git a/src/hash/maphash/smhasher_test.go b/src/hash/maphash/smhasher_test.go index a6e8a21e57..085036bd7b 100644 --- a/src/hash/maphash/smhasher_test.go +++ b/src/hash/maphash/smhasher_test.go @@ -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) diff --git a/src/runtime/hash_test.go b/src/runtime/hash_test.go index 6562829825..c1d4bfa080 100644 --- a/src/runtime/hash_test.go +++ b/src/runtime/hash_test.go @@ -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)