aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2023-07-05 16:03:55 -0400
committerCherry Mui <cherryyz@google.com>2023-07-06 20:35:47 +0000
commite6ec2a34dc1e1c319588fb0cb449abf55291977f (patch)
tree2e8c7062518ad3a6d5e6b888226b5129a0e02019
parent449ef3795d8054faf4a601d8d1aab1f624b822f5 (diff)
downloadgo-e6ec2a34dc1e1c319588fb0cb449abf55291977f.tar.gz
go-e6ec2a34dc1e1c319588fb0cb449abf55291977f.zip
runtime: print output on failure in TestMemPprof
If running testprog fails, print the output. For #60901. Change-Id: Iee80fb09412ce13bae6ac3589779a8cdf7761765 Reviewed-on: https://go-review.googlesource.com/c/go/+/507978 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
-rw-r--r--src/runtime/crash_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/crash_test.go b/src/runtime/crash_test.go
index cd978cc34b..8f11333b46 100644
--- a/src/runtime/crash_test.go
+++ b/src/runtime/crash_test.go
@@ -534,7 +534,7 @@ func TestMemPprof(t *testing.T) {
got, err := testenv.CleanCmdEnv(exec.Command(exe, "MemProf")).CombinedOutput()
if err != nil {
- t.Fatal(err)
+ t.Fatalf("testprog failed: %s, output:\n%s", err, got)
}
fn := strings.TrimSpace(string(got))
defer os.Remove(fn)