diff options
author | Dmitriy Vyukov <dvyukov@google.com> | 2012-11-03 00:26:36 +0400 |
---|---|---|
committer | Dmitriy Vyukov <dvyukov@google.com> | 2012-11-03 00:26:36 +0400 |
commit | fc4157d26a84e4eff2d4f571e87adef9bd7830c5 (patch) | |
tree | 0d6a07043ff887aaf5266f352d5a020df7ea6b7e /src/pkg/net/http/fs_test.go | |
parent | a8d54ba040f367e11d3c238274069a7b6c2da7f3 (diff) | |
download | go-fc4157d26a84e4eff2d4f571e87adef9bd7830c5.tar.gz |
net/http: fix data race in test
The issue is that server still sends body,
when client closes the fd.
Fixes issue 4329.
R=golang-dev, dave, rsc
CC=golang-dev
http://codereview.appspot.com/6822072
Diffstat (limited to 'src/pkg/net/http/fs_test.go')
-rw-r--r-- | src/pkg/net/http/fs_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/net/http/fs_test.go b/src/pkg/net/http/fs_test.go index 7c7015c29..ebe34dbcb 100644 --- a/src/pkg/net/http/fs_test.go +++ b/src/pkg/net/http/fs_test.go @@ -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) } |