From: Dmitriy Vyukov Date: Mon, 14 Nov 2011 19:31:39 +0000 (+0300) Subject: time: fix test hang X-Git-Tag: weekly.2011-11-18~67 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ba98a7ee5eab17423674e8c85c5e694700dda61c;p=gostls13.git time: fix test hang R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5374083 --- diff --git a/src/pkg/time/sleep_test.go b/src/pkg/time/sleep_test.go index dae7dfe8fb..4c4a079880 100644 --- a/src/pkg/time/sleep_test.go +++ b/src/pkg/time/sleep_test.go @@ -54,6 +54,9 @@ func TestAfterStress(t *testing.T) { go func() { for atomic.LoadUint32(&stop) == 0 { runtime.GC() + // Need to yield, because otherwise + // the main goroutine will never set the stop flag. + runtime.Gosched() } }() c := Tick(1)