Source file src/runtime/mgclimit_wasmx_test.go
1 // Copyright 2026 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build wasm || wasm32 6 7 package runtime_test 8 9 import ( 10 "runtime" 11 "runtime/debug" 12 "testing" 13 ) 14 15 func TestGCAssistUpdatesLimiter(t *testing.T) { 16 defer debug.SetGCPercent(debug.SetGCPercent(-1)) 17 runtime.GC() 18 if !runtime.GCAssistUpdatesLimiter() { 19 t.Fatal("GC assist left the CPU limiter enabled with a stale timestamp") 20 } 21 } 22