diff options
| author | Michael Anthony Knyszek <mknyszek@google.com> | 2025-08-15 21:08:50 +0000 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2025-08-15 14:45:43 -0700 |
| commit | 786be1d2bff0192288dfc2832e5012ad6b0816be (patch) | |
| tree | a5ab2e798d5912015366a29f163a6397bfb044cc /src/runtime | |
| parent | 4a7fde922ff12dce9d4e00f1b1e658fa907e488d (diff) | |
| download | go-786be1d2bff0192288dfc2832e5012ad6b0816be.tar.xz | |
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 <mpratt@google.com>
TryBot-Bypass: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/metrics_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 }() } |
