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
This commit is contained in:
Brad Fitzpatrick 2014-03-04 09:59:07 -08:00
parent c7157bf449
commit 542415c9df
1 changed files with 2 additions and 2 deletions

View File

@ -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)
}