From fc4157d26a84e4eff2d4f571e87adef9bd7830c5 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Sat, 3 Nov 2012 00:26:36 +0400 Subject: 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 --- src/pkg/net/http/fs_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pkg/net/http/fs_test.go') 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) } -- cgit v1.2.1