diff --git a/api_test.go b/api_test.go new file mode 100644 index 0000000..8269e9e --- /dev/null +++ b/api_test.go @@ -0,0 +1,15 @@ +package pyroscope + +import ( + "testing" +) + +func TestProfilerStartStop(t *testing.T) { + profiler, err := Start(Config{ + ApplicationName: "test", + }) + if err != nil { + t.Fatal(err) + } + profiler.Stop() +} diff --git a/session.go b/session.go index bb52d6e..b1510d4 100644 --- a/session.go +++ b/session.go @@ -163,6 +163,7 @@ func (ps *Session) takeSnapshots() { if ps.isCPUEnabled() { ps.cpu.Stop() } + return } } }