1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:24:50 -07:00

runtime/pprof: fix retry logic introduced by #858cd8d

The previous attempt to fix this flake was incorrect in that it
examined the vmmap output rather than the detailed error
output for the 'resource shortage' message that triggers the
retry, and hence failed to retry. This PR looks at the
detailed error output.

Fixes #62352

Change-Id: I4218b187528a95842556dc1ea27947ffcbfbc497
Reviewed-on: https://go-review.googlesource.com/c/go/+/558575
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
Cosmos Nicolaou 2024-01-25 11:55:38 -08:00 committed by Gopher Robot
parent 6a861010be
commit 9312f47d0a

View File

@ -79,9 +79,9 @@ func useVMMap(t *testing.T) (hi, lo uint64, retryable bool, err error) {
t.Logf("vmmap output: %s", out) t.Logf("vmmap output: %s", out)
if ee, ok := cmdErr.(*exec.ExitError); ok && len(ee.Stderr) > 0 { if ee, ok := cmdErr.(*exec.ExitError); ok && len(ee.Stderr) > 0 {
t.Logf("%v: %v\n%s", cmd, cmdErr, ee.Stderr) t.Logf("%v: %v\n%s", cmd, cmdErr, ee.Stderr)
retryable = bytes.Contains(ee.Stderr, []byte("resource shortage"))
} }
retryable = bytes.Contains(out, []byte("resource shortage")) t.Logf("%v: %v\n", cmd, cmdErr)
t.Logf("%v: %v", cmd, cmdErr)
if retryable { if retryable {
return 0, 0, true, cmdErr return 0, 0, true, cmdErr
} }