Change information
Commit message:
runtime/pprof: deflake TestGoroutineLeakProfileConcurrency
Issue #76540 reports failures in this test from the leaked goroutine
count being too small. The test makes an effort to wait for the
goroutines to leak, but there's no guarantee.
This change instead changes TestGoroutineLeakProfileConcurrency to wait
for the number of leaked goroutines to reach at least the minimum
expected before proceeding. This deflakes this particular issue.
The downside of this change is that a failure to detect leaked
goroutines due to a bug will lead to a timeout instead of an instant
failure, but this change makes an effort to log and report that it was
waiting for the goroutines to leak and timed out for that reason, so at
least the failure is more obvious.
Overall, this is still better than random flakes.
While we're here, I also make some minor stylistic changes and document
the helper functions a little more. I also noticed that checkFrames was
using the wrong *testing.T, so this change fixes that too.
Fixes #76540.
Change-Id: I0508855dc39b91f8c6b72d059ce88dbfc68fe748
Files:
- M src/runtime/pprof/pprof_test.go
Change size: M
Delta: 1 file changed, 74 insertions(+), 58 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Cherry Mui
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI