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>
This commit is contained in:
Ian Lance Taylor 2019-12-05 13:44:01 -08:00
parent a037582eff
commit d2dec04056
1 changed files with 1 additions and 0 deletions

View File

@ -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: