]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.garbage] runtime: Linear map test give false negative due to GC.
authorRick Hudson <rlh@golang.org>
Mon, 27 Oct 2014 18:12:54 +0000 (14:12 -0400)
committerRick Hudson <rlh@golang.org>
Mon, 27 Oct 2014 18:12:54 +0000 (14:12 -0400)
This test gives a false negative at an observed rate of 1 in a 1000
due to the fact that it runs for < 100 ms. allowing GC pauses to
warp the results. Changed the test so that it triggers only if it
remains non-linear for much larger problem sizes.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/164010043

test/maplinear.go

index 06da968ef0d9754b2d8c0b2b3693caf72a29259a..2494becb89ca95ac1660b580a83242e7127996cb 100644 (file)
@@ -45,11 +45,11 @@ func checkLinear(typ string, tries int, f func(n int)) {
                        return
                }
                fails++
-               if fails == 6 {
+               if fails == 12 {
                        panic(fmt.Sprintf("%s: too slow: %d inserts: %v; %d inserts: %v\n",
                                typ, n, t1, 2*n, t2))
                }
-               if fails < 4 {
+               if fails < 10 {
                        n *= 2
                }
        }