runtime: disable pacer lock held assertions in tests

Fixes #49234.

Change-Id: I64c1eab0dce2bbe990343b43a32858a6c9f3dcda
Reviewed-on: https://go-review.googlesource.com/c/go/+/359878
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
Michael Anthony Knyszek 2021-10-29 22:42:50 +00:00 committed by Michael Knyszek
parent 2bcf1c0373
commit b5a5b7bfb1
2 changed files with 13 additions and 3 deletions

View file

@ -1246,6 +1246,7 @@ func NewGCController(gcPercent int) *GCController {
// on a 32-bit architecture, it may get allocated unaligned
// space.
g := escape(new(GCController)).(*GCController)
g.gcControllerState.test = true // Mark it as a test copy.
g.init(int32(gcPercent))
return g
}