From: Cosmos Nicolaou Date: Thu, 25 Jan 2024 19:55:38 +0000 (-0800) Subject: runtime/pprof: fix retry logic introduced by #858cd8d X-Git-Tag: go1.23rc1~1379 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9312f47d0ac6faa32226450c0bee890cb96fb832;p=gostls13.git 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 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Reviewed-by: Michael Pratt --- diff --git a/src/runtime/pprof/vminfo_darwin_test.go b/src/runtime/pprof/vminfo_darwin_test.go index 8749a13390..ac180826b1 100644 --- a/src/runtime/pprof/vminfo_darwin_test.go +++ b/src/runtime/pprof/vminfo_darwin_test.go @@ -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 }