From e6ec2a34dc1e1c319588fb0cb449abf55291977f Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Wed, 5 Jul 2023 16:03:55 -0400 Subject: [PATCH] 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 Reviewed-by: Michael Knyszek TryBot-Result: Gopher Robot Run-TryBot: Cherry Mui --- src/runtime/crash_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.50.0