Skip to content

Commit

Permalink
Fix flaky spec
Browse files Browse the repository at this point in the history
Seems like StackProf.results is leaking between specs
when it's stubbed via `allow`, so we gotta restub it
in the profiler spec too.
  • Loading branch information
solnic committed Aug 26, 2024
1 parent ca9210e commit 5b7394f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sentry-ruby/spec/sentry/profiler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@
subject.set_initial_sample_decision(true)
subject.start
subject.stop

allow(StackProf).to receive(:results).and_return([])
end

it 'returns empty' do
expect(StackProf).to receive(:results).and_call_original
expect(subject.to_hash).to eq({})
end

Expand Down

0 comments on commit 5b7394f

Please sign in to comment.