From d2dec04056cfa33c70b7fc4a72fd3d98b78bf385 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 5 Dec 2019 13:44:01 -0800 Subject: [PATCH] runtime: add Gosched to TestSelectStackAdjust loop Give the runtime more of a chance to do other work in a tight loop. Fixes #34693 Change-Id: I8df6173d2c93ecaccecf4520a6913b495787df78 Reviewed-on: https://go-review.googlesource.com/c/go/+/210217 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/runtime/chan_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/chan_test.go b/src/runtime/chan_test.go index d4752dd344..039a086e9b 100644 --- a/src/runtime/chan_test.go +++ b/src/runtime/chan_test.go @@ -719,6 +719,7 @@ func TestSelectStackAdjust(t *testing.T) { if after.NumGC-before.NumGC >= 2 { goto done } + runtime.Gosched() } t.Fatal("failed to trigger concurrent GC") done: -- 2.50.0