]> Cypherpunks repositories - gostls13.git/commitdiff
net/http, net/http/httputil: fix TestChunkReaderAllocs failure when GOMAXPROCS > 1
authorShenghou Ma <minux.ma@gmail.com>
Tue, 20 Nov 2012 18:18:34 +0000 (02:18 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Tue, 20 Nov 2012 18:18:34 +0000 (02:18 +0800)
R=fullung, bradfitz, dave
CC=golang-dev
https://golang.org/cl/6846081

src/pkg/net/http/chunked_test.go
src/pkg/net/http/httputil/chunked_test.go

index ad88eb16735accbb3f5b5ac1e1120fb58596e28a..0b18c7b55ec23da26dee90affa869da71449dbae 100644 (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")
index 22c1bb75489d7ec2c6028ff622d668b8e7af8a12..a06bffad5b30f7032cc7bd24a52ed537dbd40f29 100644 (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")