From 7bce6f9386153d77ad1293ae1e39cfa214d9d02c Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Wed, 21 Nov 2012 02:18:34 +0800 Subject: [PATCH] net/http, net/http/httputil: fix TestChunkReaderAllocs failure when GOMAXPROCS > 1 R=fullung, bradfitz, dave CC=golang-dev https://golang.org/cl/6846081 --- src/pkg/net/http/chunked_test.go | 2 ++ src/pkg/net/http/httputil/chunked_test.go | 2 ++ 2 files changed, 4 insertions(+) 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") -- 2.48.1