]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: relax TestProfilerStackDepth
authorNick Ripley <nick.ripley@datadoghq.com>
Fri, 1 Nov 2024 17:43:34 +0000 (13:43 -0400)
committerNick Ripley <nick.ripley@datadoghq.com>
Mon, 4 Nov 2024 17:35:11 +0000 (17:35 +0000)
commite8bb9129d185bf98ba173ec018bf2b6c9d62aa6c
tree4362a4674a4c26eef0ba9f3adf0898a28b9f16fd
parentea38fa534559d1c25e629d0b1e96a730fa96780b
runtime/pprof: relax TestProfilerStackDepth

The TestProfilerStackDepth/heap test can spuriously fail if the profiler
happens to capture a stack with an allocation several frames deep into
runtime code. The pprof API hides runtime frames at the leaf-end of
stacks, but those frames still count against the profiler's stack depth
limit. The test checks only the first stack it finds with the desired
prefix and fails if it's not deep enough or doesn't have the right root
frame. So it can fail in that scenario, even though the implementation
isn't really broken.

Relax the test to check that there is at least one stack with desired
prefix, depth, and root frame.

Fixes #70112

Change-Id: I337fb3cccd1ddde76530b03aa1ec0f9608aa4112
Reviewed-on: https://go-review.googlesource.com/c/go/+/623998
Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/pprof/pprof_test.go