Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sentry-ruby/spec/sentry/vernier/profiler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
end
end

after do
Vernier.stop_profile if Vernier.instance_variable_get(:@collector)
end
Comment thread
sl0thentr0py marked this conversation as resolved.

let(:profiles_sample_rate) { 1.0 }
let(:traces_sample_rate) { 1.0 }

Expand Down Expand Up @@ -147,7 +151,7 @@
it 'stops Vernier if sampled and started' do
profiler.set_initial_sample_decision(true)
profiler.start
expect(Vernier).to receive(:stop_profile)
expect(Vernier).to receive(:stop_profile).and_call_original
profiler.stop
end

Expand All @@ -161,7 +165,10 @@
it 'does not crash when stopping Vernier crashed' do
profiler.set_initial_sample_decision(true)
profiler.start
expect(Vernier).to receive(:stop_profile).and_raise(RuntimeError.new("Profile not started"))
expect(Vernier).to receive(:stop_profile).and_wrap_original do |stop_profile|
stop_profile.call
raise RuntimeError.new("Profile not started")
end
profiler.stop
end
end
Expand Down
Loading