1
0
mirror of https://github.com/golang/go synced 2024-11-14 20:00:31 -07:00

Revert "runtime/pprof: make TestBlockMutexProfileInlineExpansion stricter"

This reverts commit 5b0f8596b7.

Reason for revert: This CL breaks gotip-linux-amd64-noopt builder.

Change-Id: I3950211f05c90e4955c0785409b796987741a9f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/617715
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
Nick Ripley 2024-10-03 13:11:43 +00:00 committed by Gopher Robot
parent 58e046b66c
commit 1edb49a6eb

View File

@ -2729,36 +2729,36 @@ func TestBlockMutexProfileInlineExpansion(t *testing.T) {
tcs := []struct {
Name string
Collect func([]runtime.BlockProfileRecord) (int, bool)
Stack string
SubStack string
}{
{
Name: "mutex",
Collect: runtime.MutexProfile,
Stack: `sync.(*Mutex).Unlock
SubStack: `sync.(*Mutex).Unlock
runtime/pprof.inlineF
runtime/pprof.inlineE
runtime/pprof.inlineD
runtime.goexit`,
runtime/pprof.inlineD`,
},
{
Name: "block",
Collect: runtime.BlockProfile,
Stack: `sync.(*Mutex).Lock
SubStack: `sync.(*Mutex).Lock
runtime/pprof.inlineC
runtime/pprof.inlineB
runtime/pprof.inlineA
runtime.goexit`,
runtime/pprof.inlineA`,
},
}
for _, tc := range tcs {
t.Run(tc.Name, func(t *testing.T) {
stacks := getProfileStacks(tc.Collect, false)
if slices.Contains(stacks, tc.Stack) {
for _, s := range stacks {
if strings.Contains(s, tc.SubStack) {
return
}
}
t.Error("did not see expected stack")
t.Logf("wanted:\n%s", tc.Stack)
t.Logf("wanted:\n%s", tc.SubStack)
t.Logf("got: %s", stacks)
})
}