From: Paul E. Murphy Date: Fri, 19 Nov 2021 22:33:42 +0000 (-0600) Subject: misc/cgo/test: further reduce likeliness of hang in Test9400 X-Git-Tag: go1.18beta1~142 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7ccbcc90560468937f02609a43cb39a6e13ff797;p=gostls13.git misc/cgo/test: further reduce likeliness of hang in Test9400 As suggested by #49680, a GC could be in-progress when we disable GC. Force a GC after we pause to ensure we don't hang in this case. For #49695 Change-Id: I4fc4c06ef2ac174217c3dcf7d58c7669226e2d24 Reviewed-on: https://go-review.googlesource.com/c/go/+/367874 Run-TryBot: Paul Murphy TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor Trust: Paul Murphy --- diff --git a/misc/cgo/test/testdata/issue9400_linux.go b/misc/cgo/test/testdata/issue9400_linux.go index f521b1f49a..47f224dc4f 100644 --- a/misc/cgo/test/testdata/issue9400_linux.go +++ b/misc/cgo/test/testdata/issue9400_linux.go @@ -50,6 +50,8 @@ func test9400(t *testing.T) { // Disable GC for the duration of the test. // This avoids a potential GC deadlock when spinning in uninterruptable ASM below #49695. defer debug.SetGCPercent(debug.SetGCPercent(-1)) + // And finish any pending GC after we pause, if any. + runtime.GC() // Temporarily rewind the stack and trigger SIGSETXID issue9400.RewindAndSetgid()