]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/pprof: fix retry logic introduced by #858cd8d
authorCosmos Nicolaou <cosmos.nicolaou@gmail.com>
Thu, 25 Jan 2024 19:55:38 +0000 (11:55 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 25 Jan 2024 20:51:58 +0000 (20:51 +0000)
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>
src/runtime/pprof/vminfo_darwin_test.go

index 8749a13390245d759e85952dec71e02d0cd00e70..ac180826b149836f73a8d8ec4113c1a4a9991530 100644 (file)
@@ -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
                }