From: Rob Pike Date: Sun, 22 Jan 2012 17:25:47 +0000 (-0800) Subject: bytes: delete the test for huge buffers X-Git-Tag: weekly.2012-01-27~118 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=87079cc14c98cb82d98f3e564fe5e89cbd7d8ff6;p=gostls13.git bytes: delete the test for huge buffers It takes too much memory to be reliable and causes trouble on 32-bit machines. Sigh. Fixes #2756. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5567043 --- diff --git a/src/pkg/bytes/buffer_test.go b/src/pkg/bytes/buffer_test.go index 59211deb21..d0af11f104 100644 --- a/src/pkg/bytes/buffer_test.go +++ b/src/pkg/bytes/buffer_test.go @@ -386,24 +386,3 @@ func TestReadEmptyAtEOF(t *testing.T) { t.Errorf("wrong count; got %d want 0", n) } } - -func TestHuge(t *testing.T) { - // About to use tons of memory, so avoid for simple installation testing. - if testing.Short() { - return - } - // We expect a panic. - defer func() { - if err, ok := recover().(error); ok && err == ErrTooLarge { - return - } else { - t.Error(`expected "too large" error; got`, err) - } - }() - b := new(Buffer) - big := make([]byte, 500e6) - for i := 0; i < 1000; i++ { - b.Write(big) - } - t.Error("panic expected") -}