Commit 542415c9 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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
parent c7157bf4
...@@ -2235,8 +2235,8 @@ func TestResponseWriterWriteStringAllocs(t *testing.T) { ...@@ -2235,8 +2235,8 @@ func TestResponseWriterWriteStringAllocs(t *testing.T) {
w.Write([]byte("Hello world")) w.Write([]byte("Hello world"))
} }
})) }))
before := testing.AllocsPerRun(25, func() { ht.rawResponse("GET / HTTP/1.0") }) before := testing.AllocsPerRun(50, func() { ht.rawResponse("GET / HTTP/1.0") })
after := testing.AllocsPerRun(25, func() { ht.rawResponse("GET /s HTTP/1.0") }) after := testing.AllocsPerRun(50, func() { ht.rawResponse("GET /s HTTP/1.0") })
if int(after) >= int(before) { if int(after) >= int(before) {
t.Errorf("WriteString allocs of %v >= Write allocs of %v", after, before) t.Errorf("WriteString allocs of %v >= Write allocs of %v", after, before)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment