Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: TestMemStats fails after running tests and benchmarks for some time #22696

Closed
mvdan opened this issue Nov 13, 2017 · 4 comments

Comments

Projects
None yet
5 participants
@mvdan
Copy link
Member

commented Nov 13, 2017

go version devel +79dbc1cc7b Sun Nov 12 13:25:35 2017 +0000 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mvdan/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mvdan/go/land:/home/mvdan/go"
GORACE=""
GOROOT="/home/mvdan/tip"
GOTMPDIR=""
GOTOOLDIR="/home/mvdan/tip/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build917956427=/tmp/go-build -gno-record-gcc-switches"
$ go test -bench=Mem -count 10 runtime
--- FAIL: TestMemStats (0.00s)
        malloc_test.go:75: TotalAlloc = 108745353624: insanely high value (overflow?); want <= 1e+11
^Csignal: interrupt
FAIL    runtime 496.137s

Note that the test succeeds fine on its own, even when it's run thousands of times.

Also note that it took my laptop over 5 minutes to reach this point. Might be reached faster on a more powerful machine.

@mvdan

This comment has been minimized.

Copy link
Member Author

commented Nov 13, 2017

The upper threshold seems to be applied in the test code, so labelling as a testing bug.

@mvdan mvdan added the Testing label Nov 13, 2017

@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Nov 15, 2017

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2017

@aclements

This comment has been minimized.

Copy link
Member

commented Nov 22, 2017

Hmm. It's not really clear what we can do about this. TestMemStats is just sanity checking a bunch of values and if you run the tests long enough they simply won't be sane any more. We could loosen the thresholds, but then it's not as useful in the normal case.

Maybe it should keep track of how many times it's run and start skipping after some N?

/cc @RLH

@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Jul 8, 2018

Change https://golang.org/cl/122586 mentions this issue: runtime: only run TestMemStats sanity tests once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.