From 9312f47d0ac6faa32226450c0bee890cb96fb832 Mon Sep 17 00:00:00 2001 From: Cosmos Nicolaou Date: Thu, 25 Jan 2024 11:55:38 -0800 Subject: [PATCH] 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 --- src/runtime/pprof/vminfo_darwin_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }