// desired maximum number of frames after expansion.
// This should be at least as large as the largest skip value
// used for profiling; otherwise stacks may be truncated inconsistently
- maxSkip = 8
+ maxSkip = 6
// maxProfStackDepth is the highest valid value for debug.profstackdepth.
// It's used for the bucket.stk func.
for _, test := range tests {
t.Run(test.profiler, func(t *testing.T) {
- if test.profiler == "heap" {
- testenv.SkipFlaky(t, 74029)
- }
var buf bytes.Buffer
if err := Lookup(test.profiler).WriteTo(&buf, 0); err != nil {
t.Fatalf("failed to write heap profile: %v", err)
t.Logf("matched stack=%s", stk)
if len(stk) != depth {
t.Errorf("want stack depth = %d, got %d", depth, len(stk))
+ continue
}
if rootFn, wantFn := stk[depth-1], "runtime/pprof.allocDeep"; rootFn != wantFn {
// guaranteed to have exactly the desired depth with produceProfileEvents as
// their root frame which is expected by TestProfilerStackDepth.
func produceProfileEvents(t *testing.T, depth int) {
- allocDeep(depth + 1) // +1 for produceProfileEvents, **
+ allocDeep(depth - 1) // -1 for produceProfileEvents, **
blockChanDeep(t, depth-2) // -2 for produceProfileEvents, **, chanrecv1
blockMutexDeep(t, depth-2) // -2 for produceProfileEvents, **, Unlock
memSink = nil