mirror of
https://github.com/golang/go
synced 2024-11-24 07:40:17 -07:00
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 <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
bfcb5b6406
commit
4d6788ecae
@ -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) {
|
|||||||
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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user