]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: eliminate arbitrary deadline in testCPUProfile
authorBryan C. Mills <bcmills@google.com>
Mon, 16 May 2022 15:41:12 +0000 (11:41 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 16 May 2022 16:15:58 +0000 (16:15 +0000)
commitdb875f4d1b125e41a3999e3dd5c30d6b1bce235c
tree9385a3a4d711e930a273fd16449c86a7beea5f25
parent2a6e13843d5bc0a380ce7081e33db9b636e394f9
runtime/pprof: eliminate arbitrary deadline in testCPUProfile

The testCPUProfile helper function iterates until the profile contains
enough samples. However, in general very slow builders may need longer
to complete tests, and may have less-responsive schedulers (leading to
longer durations required to collect profiles with enough samples).
To compensate, slower builders generally run tests with longer timeouts.

Since this test helper already dynamically scales the profile duration
based on the collected samples, allow it to continue to retry and
rescale until it would exceed the test's deadline.

Fixes #52656 (hopefully).

Change-Id: I4561e721927503f33a6d23336efa979bb9d3221f
Reviewed-on: https://go-review.googlesource.com/c/go/+/406614
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/runtime/pprof/pprof_test.go