From: Russ Cox Date: Fri, 8 Mar 2013 16:25:21 +0000 (-0500) Subject: runtime: make TestStackMem a little less flaky X-Git-Tag: go1.1rc2~632 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=091d7210c7bbcc7497a48a41be091e1957d17717;p=gostls13.git runtime: make TestStackMem a little less flaky Have seen failures with GOMAXPROCS=4 on Windows. R=golang-dev, r CC=golang-dev https://golang.org/cl/7626043 --- diff --git a/src/pkg/runtime/stack_test.go b/src/pkg/runtime/stack_test.go index 759f7c46ed..74f29f34ec 100644 --- a/src/pkg/runtime/stack_test.go +++ b/src/pkg/runtime/stack_test.go @@ -1533,7 +1533,7 @@ func stack5000() (uintptr, uintptr) { var buf [5000]byte; use(buf[:]); return St func TestStackMem(t *testing.T) { const ( BatchSize = 32 - BatchCount = 512 + BatchCount = 256 ArraySize = 1024 RecursionDepth = 128 ) @@ -1562,6 +1562,11 @@ func TestStackMem(t *testing.T) { for i := 0; i < BatchSize; i++ { <-c } + + // The goroutines have signaled via c that they are ready to exit. + // Give them a chance to exit by sleeping. If we don't wait, we + // might not reuse them on the next batch. + time.Sleep(10 * time.Millisecond) } s1 := new(MemStats) ReadMemStats(s1)