Commit 4d6788ec authored by Mohit Agarwal's avatar Mohit Agarwal Committed by Brad Fitzpatrick

runtime: clean up profiling data files produced by TestCgoPprof

Fixes #15541

Change-Id: I9b6835157db0eb86de13591e785f971ffe754baa
Reviewed-on: https://go-review.googlesource.com/22783Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent bfcb5b64
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"internal/testenv" "internal/testenv"
"os"
"os/exec" "os/exec"
"runtime" "runtime"
"strings" "strings"
...@@ -250,6 +251,7 @@ func TestCgoPprof(t *testing.T) { ...@@ -250,6 +251,7 @@ func TestCgoPprof(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
fn := strings.TrimSpace(string(got)) fn := strings.TrimSpace(string(got))
defer os.Remove(fn)
top, err := exec.Command("go", "tool", "pprof", "-top", "-nodecount=1", exe, fn).CombinedOutput() top, err := exec.Command("go", "tool", "pprof", "-top", "-nodecount=1", exe, fn).CombinedOutput()
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment