mirror of
https://github.com/golang/go
synced 2024-11-23 05:40:04 -07:00
runtime: better error from TestGcSys when gc is disabled
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7390047
This commit is contained in:
parent
94fab3cad3
commit
5833c96b0a
@ -5,11 +5,15 @@
|
||||
package runtime_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGcSys(t *testing.T) {
|
||||
if os.Getenv("GOGC") == "off" {
|
||||
t.Fatalf("GOGC=off in environment; test cannot pass")
|
||||
}
|
||||
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
|
||||
memstats := new(runtime.MemStats)
|
||||
runtime.GC()
|
||||
|
Loading…
Reference in New Issue
Block a user