1
0
mirror of https://github.com/golang/go synced 2024-11-14 22:20:21 -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 { tcs := []struct {
Name string Name string
Collect func([]runtime.BlockProfileRecord) (int, bool) Collect func([]runtime.BlockProfileRecord) (int, bool)
Stack string SubStack string
}{ }{
{ {
Name: "mutex", Name: "mutex",
Collect: runtime.MutexProfile, Collect: runtime.MutexProfile,
Stack: `sync.(*Mutex).Unlock SubStack: `sync.(*Mutex).Unlock
runtime/pprof.inlineF runtime/pprof.inlineF
runtime/pprof.inlineE runtime/pprof.inlineE
runtime/pprof.inlineD runtime/pprof.inlineD`,
runtime.goexit`,
}, },
{ {
Name: "block", Name: "block",
Collect: runtime.BlockProfile, Collect: runtime.BlockProfile,
Stack: `sync.(*Mutex).Lock SubStack: `sync.(*Mutex).Lock
runtime/pprof.inlineC runtime/pprof.inlineC
runtime/pprof.inlineB runtime/pprof.inlineB
runtime/pprof.inlineA runtime/pprof.inlineA`,
runtime.goexit`,
}, },
} }
for _, tc := range tcs { for _, tc := range tcs {
t.Run(tc.Name, func(t *testing.T) { t.Run(tc.Name, func(t *testing.T) {
stacks := getProfileStacks(tc.Collect, false) stacks := getProfileStacks(tc.Collect, false)
if slices.Contains(stacks, tc.Stack) { for _, s := range stacks {
if strings.Contains(s, tc.SubStack) {
return return
} }
}
t.Error("did not see expected stack") 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) t.Logf("got: %s", stacks)
}) })
} }