From c4099c7593fea9c594ad0e8969452a741acba4c7 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 11 Nov 2016 11:25:15 -0500 Subject: [PATCH] runtime/pprof: delete new TestCPUProfileParse All the existing CPU profiler tests already parse the profile. That should be sufficient indication that profiles can be parsed. Fixes #17853. Change-Id: Ie8a190e2ae4eef125c8eb0d4e8b7adac420abbdb Reviewed-on: https://go-review.googlesource.com/33136 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/runtime/pprof/pprof_test.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index c19ea3507d..eb8fcc90db 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -651,23 +651,3 @@ func containsInOrder(s string, all ...string) bool { } return true } - -// Tests that the profiler outputs a parsable protobuf Profile profile. -func TestCPUProfileParse(t *testing.T) { - - var before, after runtime.MemStats - runtime.ReadMemStats(&before) - var buf bytes.Buffer - - if err := StartCPUProfile(&buf); err != nil { - t.Fatalf("Profile failed: Could not enable CPU profiling: %s\n", err) - } - time.Sleep(5 * time.Second) - StopCPUProfile() - - runtime.ReadMemStats(&after) - _, err := profile.Parse(&buf) - if err != nil { - t.Fatalf("Could not parse Profile profile: %v", err) - } -} -- 2.48.1