mirror of https://github.com/golang/go.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
This commit is contained in:
parent
c7157bf449
commit
542415c9df
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue