From 3e3dee68503fb51294cde191b3d359c861d65e79 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Fri, 9 Feb 2018 13:05:52 +0100 Subject: [PATCH] Print stderr from go tool pprof in profile gatherer --- test/e2e/framework/profile_gatherer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/framework/profile_gatherer.go b/test/e2e/framework/profile_gatherer.go index f643c7ce6a7..76e3e3895bf 100644 --- a/test/e2e/framework/profile_gatherer.go +++ b/test/e2e/framework/profile_gatherer.go @@ -17,6 +17,7 @@ limitations under the License. package framework import ( + "bytes" "fmt" "io/ioutil" "os" @@ -107,8 +108,10 @@ func gatherProfileOfKind(profileBaseName, kind string) error { } defer outfile.Close() cmd.Stdout = outfile + stderr := bytes.NewBuffer(nil) + cmd.Stderr = stderr if err := cmd.Run(); nil != err { - return fmt.Errorf("Failed to run 'go tool pprof': %v", err) + return fmt.Errorf("Failed to run 'go tool pprof': %v, stderr: %#v", err, stderr.String()) } return nil }