diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index 4c5712d32f6390..4471ee5afbbb75 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -7,6 +7,7 @@ package runtime_test import ( "math" "runtime" + "runtime/debug" "sync" "sync/atomic" "syscall" @@ -104,8 +105,8 @@ func TestGoroutineParallelism(t *testing.T) { defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(P)) // If runtime triggers a forced GC during this test then it will deadlock, // since the goroutines can't be stopped/preempted. - // So give this test as much time as possible. - runtime.GC() + // Disable GC for this test (see issue #10958). + defer debug.SetGCPercent(debug.SetGCPercent(-1)) for try := 0; try < N; try++ { done := make(chan bool) x := uint32(0)