]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: print output on failure in TestMemPprof
authorCherry Mui <cherryyz@google.com>
Wed, 5 Jul 2023 20:03:55 +0000 (16:03 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 6 Jul 2023 20:35:47 +0000 (20:35 +0000)
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>

src/runtime/crash_test.go

index cd978cc34b55924ceb6ac2b400976470c5c3e141..8f11333b462535f4e94e2646c177d57dc1c834eb 100644 (file)
@@ -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)