Skip to content

Commit

Permalink
runtime/pprof: fix retry logic introduced by #858cd8d
Browse files Browse the repository at this point in the history
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 golang#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>
  • Loading branch information
cosnicolaou authored and ezz-no committed Feb 17, 2024
1 parent e617007 commit 4b8d57e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/pprof/vminfo_darwin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ func useVMMap(t *testing.T) (hi, lo uint64, retryable bool, err error) {
t.Logf("vmmap output: %s", out)
if ee, ok := cmdErr.(*exec.ExitError); ok && len(ee.Stderr) > 0 {
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", cmd, cmdErr)
t.Logf("%v: %v\n", cmd, cmdErr)
if retryable {
return 0, 0, true, cmdErr
}
Expand Down

0 comments on commit 4b8d57e

Please sign in to comment.