net/http, net/http/httputil: fix TestChunkReaderAllocs failure when GOMAXPROCS > 1

R=fullung, bradfitz, dave
CC=golang-dev
https://golang.org/cl/6846081
This commit is contained in:
Shenghou Ma 2012-11-21 02:18:34 +08:00
parent 4bf261f9e3
commit 7bce6f9386
2 changed files with 4 additions and 0 deletions

View File

@ -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")

View File

@ -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")