From: Cherry Mui Date: Wed, 5 Jul 2023 20:03:55 +0000 (-0400) Subject: runtime: print output on failure in TestMemPprof X-Git-Tag: go1.21rc3~2^2~23 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e6ec2a34dc1e1c319588fb0cb449abf55291977f;p=gostls13.git 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 --- 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)