1
0
mirror of https://github.com/golang/go synced 2024-10-03 05:11:21 -06:00

net/http: fix data race in test

The issue is that server still sends body,
when client closes the fd.
Fixes #4329.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6822072
This commit is contained in:
Dmitriy Vyukov 2012-11-03 00:26:36 +04:00
parent 31f8b07e55
commit 600de1fb3d

View File

@ -648,6 +648,8 @@ func TestServeContent(t *testing.T) {
if err != nil {
t.Fatal(err)
}
io.Copy(ioutil.Discard, res.Body)
res.Body.Close()
if res.StatusCode != tt.wantStatus {
t.Errorf("test %q: status = %d; want %d", testName, res.StatusCode, tt.wantStatus)
}