Skip to content

Commit 786be1d

Browse files
committed
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 <[email protected]> TryBot-Bypass: Michael Knyszek <[email protected]>
1 parent 4a7fde9 commit 786be1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/metrics_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ func TestReadMetricsSched(t *testing.T) {
17741774
t.Run("waiting", func(t *testing.T) {
17751775
// Force waiting count to be high.
17761776
const waitingCount = 1000
1777-
stop = make(chan bool)
1777+
stop := make(chan bool)
17781778
for i := 0; i < waitingCount; i++ {
17791779
go func() { <-stop }()
17801780
}

0 commit comments

Comments
 (0)