From: Mohit Agarwal Date: Wed, 4 May 2016 18:34:54 +0000 (+0530) Subject: runtime: clean up profiling data files produced by TestCgoPprof X-Git-Tag: go1.7beta1~334 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4d6788ecae127017ab4ab4d5d5907b8912a08bd6;p=gostls13.git runtime: clean up profiling data files produced by TestCgoPprof Fixes #15541 Change-Id: I9b6835157db0eb86de13591e785f971ffe754baa Reviewed-on: https://go-review.googlesource.com/22783 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go index f9d665650b..cb46c2a5dc 100644 --- a/src/runtime/crash_cgo_test.go +++ b/src/runtime/crash_cgo_test.go @@ -10,6 +10,7 @@ import ( "bytes" "fmt" "internal/testenv" + "os" "os/exec" "runtime" "strings" @@ -250,6 +251,7 @@ func TestCgoPprof(t *testing.T) { t.Fatal(err) } fn := strings.TrimSpace(string(got)) + defer os.Remove(fn) top, err := exec.Command("go", "tool", "pprof", "-top", "-nodecount=1", exe, fn).CombinedOutput() if err != nil {