From 600de1fb3db279be87f4b9fab0a09463fe1568e1 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Sat, 3 Nov 2012 00:26:36 +0400 Subject: [PATCH] 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 --- src/pkg/net/http/fs_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pkg/net/http/fs_test.go b/src/pkg/net/http/fs_test.go index 7c7015c297..ebe34dbcbf 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) }