From 786be1d2bff0192288dfc2832e5012ad6b0816be Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Fri, 15 Aug 2025 21:08:50 +0000 Subject: [PATCH] runtime: don't overwrite global stop channel in tests This is used by TestStopTheWorldDeadlock, and the new TestReadMetricsSched test accidentally modifies this global variable instead of (as intended) defining a local one. Change-Id: I7aaece83f285d051ad8b56b7591c76613c39613a Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/696556 Reviewed-by: Michael Pratt TryBot-Bypass: Michael Knyszek --- src/runtime/metrics_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/metrics_test.go b/src/runtime/metrics_test.go index 385891d7d9..f565d8a59f 100644 --- a/src/runtime/metrics_test.go +++ b/src/runtime/metrics_test.go @@ -1774,7 +1774,7 @@ func TestReadMetricsSched(t *testing.T) { t.Run("waiting", func(t *testing.T) { // Force waiting count to be high. const waitingCount = 1000 - stop = make(chan bool) + stop := make(chan bool) for i := 0; i < waitingCount; i++ { go func() { <-stop }() } -- 2.51.0