[go] runtime/pprof: deflake TestGoroutineLeakProfileConcurrency

0 views
Skip to first unread message

Michael Knyszek (Gerrit)

unread,
Dec 12, 2025, 3:00:31 PM (4 days ago) Dec 12
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Cherry Mui, Go LUCI, Michael Pratt, golang-co...@googlegroups.com

Michael Knyszek submitted the change

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
Reviewed-by: Cherry Mui <cher...@google.com>
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:
  • requirement satisfiedCode-Review: +2 by Cherry Mui
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I0508855dc39b91f8c6b72d059ce88dbfc68fe748
Gerrit-Change-Number: 729280
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Knyszek <mkny...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages