aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/chan_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-12-05 13:44:01 -0800
committerIan Lance Taylor <iant@golang.org>2019-12-06 03:07:20 +0000
commitd2dec04056cfa33c70b7fc4a72fd3d98b78bf385 (patch)
treec175bb98efed1308b75559a359f3145901e64beb /src/runtime/chan_test.go
parenta037582efff56082631508b15b287494df6e9b69 (diff)
downloadgo-d2dec04056cfa33c70b7fc4a72fd3d98b78bf385.tar.gz
go-d2dec04056cfa33c70b7fc4a72fd3d98b78bf385.zip
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 <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/chan_test.go')
-rw-r--r--src/runtime/chan_test.go1
1 files changed, 1 insertions, 0 deletions
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: