From: Shenghou Ma Date: Tue, 20 Nov 2012 18:18:34 +0000 (+0800) Subject: net/http, net/http/httputil: fix TestChunkReaderAllocs failure when GOMAXPROCS > 1 X-Git-Tag: go1.1rc2~1830 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7bce6f9386153d77ad1293ae1e39cfa214d9d02c;p=gostls13.git net/http, net/http/httputil: fix TestChunkReaderAllocs failure when GOMAXPROCS > 1 R=fullung, bradfitz, dave CC=golang-dev https://golang.org/cl/6846081 --- diff --git a/src/pkg/net/http/chunked_test.go b/src/pkg/net/http/chunked_test.go index ad88eb1673..0b18c7b55e 100644 --- a/src/pkg/net/http/chunked_test.go +++ b/src/pkg/net/http/chunked_test.go @@ -42,6 +42,8 @@ func TestChunk(t *testing.T) { } func TestChunkReaderAllocs(t *testing.T) { + // temporarily set GOMAXPROCS to 1 as we are testing memory allocations + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1)) var buf bytes.Buffer w := newChunkedWriter(&buf) a, b, c := []byte("aaaaaa"), []byte("bbbbbbbbbbbb"), []byte("cccccccccccccccccccccccc") diff --git a/src/pkg/net/http/httputil/chunked_test.go b/src/pkg/net/http/httputil/chunked_test.go index 22c1bb7548..a06bffad5b 100644 --- a/src/pkg/net/http/httputil/chunked_test.go +++ b/src/pkg/net/http/httputil/chunked_test.go @@ -44,6 +44,8 @@ func TestChunk(t *testing.T) { } func TestChunkReaderAllocs(t *testing.T) { + // temporarily set GOMAXPROCS to 1 as we are testing memory allocations + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1)) var buf bytes.Buffer w := NewChunkedWriter(&buf) a, b, c := []byte("aaaaaa"), []byte("bbbbbbbbbbbb"), []byte("cccccccccccccccccccccccc")