1
0
mirror of https://github.com/golang/go synced 2024-11-08 05:56:12 -07:00
go/src/runtime/pprof
Hana Kim 9eb2c43474 runtime/pprof: allow tests to run multiple times
TestMutexProfile and TestEmptyCallStack couldn't run multiple times
because they mutate state in runtime (mutex profile counters and
a user-defined profile type) and test whether the state
matches what it is supposed to be after the very first run.

We fix TestMutexProfile by relaxing the expected state condition.
We fix TestEmptyCallStack by creating a new profile with a different
name every time the test runs.

For #25520

Change-Id: I8e50cd9526eb650c8989457495ff90a24ce07863
Reviewed-on: https://go-review.googlesource.com/114495
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-24 20:26:47 +00:00
..
internal/profile
testdata
elf.go
label_test.go
label.go
map.go
mprof_test.go
pprof_test.go runtime/pprof: allow tests to run multiple times 2018-05-24 20:26:47 +00:00
pprof.go runtime/pprof: update stale link in documentation 2018-05-21 14:43:00 +00:00
proto_test.go
proto.go
protobuf.go
protomem_test.go
protomem.go
runtime_test.go
runtime.go