From: Brad Fitzpatrick Date: Tue, 4 Mar 2014 17:59:07 +0000 (-0800) Subject: net/http: deflake another alloc test X-Git-Tag: go1.3beta1~486 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=542415c9df03e40a99ef9eb1005e43ba2cadc46a;p=gostls13.git net/http: deflake another alloc test I have one machine where this 25 test run is flaky and fails ("21 >= 21"), but 50 works everywhere. LGTM=josharian R=josharian CC=golang-codereviews https://golang.org/cl/67870053 --- diff --git a/src/pkg/net/http/serve_test.go b/src/pkg/net/http/serve_test.go index 21cd67f9dc..c1ea537d85 100644 --- a/src/pkg/net/http/serve_test.go +++ b/src/pkg/net/http/serve_test.go @@ -2235,8 +2235,8 @@ func TestResponseWriterWriteStringAllocs(t *testing.T) { w.Write([]byte("Hello world")) } })) - before := testing.AllocsPerRun(25, func() { ht.rawResponse("GET / HTTP/1.0") }) - after := testing.AllocsPerRun(25, func() { ht.rawResponse("GET /s HTTP/1.0") }) + before := testing.AllocsPerRun(50, func() { ht.rawResponse("GET / HTTP/1.0") }) + after := testing.AllocsPerRun(50, func() { ht.rawResponse("GET /s HTTP/1.0") }) if int(after) >= int(before) { t.Errorf("WriteString allocs of %v >= Write allocs of %v", after, before) }