From: Keith Randall Date: Fri, 9 May 2014 22:50:57 +0000 (-0700) Subject: runtime: be a lot more lenient on smhasher avalanche test. X-Git-Tag: go1.3beta2~108 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=711d1ad7eebc4aecfb3a326f16af206b7b99ff6c;p=gostls13.git runtime: be a lot more lenient on smhasher avalanche test. Fixes #7943 LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/98170043 --- diff --git a/src/pkg/runtime/hash_test.go b/src/pkg/runtime/hash_test.go index 312c4be8e9..1c11e0538d 100644 --- a/src/pkg/runtime/hash_test.go +++ b/src/pkg/runtime/hash_test.go @@ -397,10 +397,10 @@ func avalancheTest1(t *testing.T, k Key) { // all sums inside those bounds with 99% probability. N := n * hashSize var c float64 - // find c such that Prob(mean-c*stddev < x < mean+c*stddev)^N > .99 - for c = 0.0; math.Pow(math.Erf(c/math.Sqrt(2)), float64(N)) < .99; c += .1 { + // 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 *= 2.0 // allowed slack - we don't need to be perfectly random + c *= 4.0 // allowed slack - we don't need to be perfectly random mean := .5 * REP stddev := .5 * math.Sqrt(REP) low := int(mean - c*stddev)