summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Hudson <rlh@golang.org>2014-10-27 14:12:54 -0400
committerRick Hudson <rlh@golang.org>2014-10-27 14:12:54 -0400
commit9c3e9321435fd5c96624b1a199e1834d3eb08a2f (patch)
tree1e22fac290f7770174355d37f13356d0a0836562
parent2c987a9ddefd9d256bf9e7e21396e2485a7d6514 (diff)
downloadgo-9c3e9321435fd5c96624b1a199e1834d3eb08a2f.tar.gz
[dev.garbage] runtime: Linear map test give false negative due to GC.
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://codereview.appspot.com/164010043
-rw-r--r--test/maplinear.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/maplinear.go b/test/maplinear.go
index 06da968ef..2494becb8 100644
--- a/test/maplinear.go
+++ b/test/maplinear.go
@@ -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
}
}