mirror of
https://github.com/golang/go
synced 2024-11-27 00:01:23 -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
|
package runtime_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGcSys(t *testing.T) {
|
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))
|
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
|
||||||
memstats := new(runtime.MemStats)
|
memstats := new(runtime.MemStats)
|
||||||
runtime.GC()
|
runtime.GC()
|
||||||
|
Loading…
Reference in New Issue
Block a user