Skip to content

Commit

Permalink
Assert that no crashtracker is running before each test
Browse files Browse the repository at this point in the history
This makes the test fail early if there's an unexpected crash tracker
instance running, rather than failing later in a more confusing way.
  • Loading branch information
ivoanjo committed May 10, 2024
1 parent 09976cc commit 5431d2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/datadog/profiling/crashtracker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
require 'webrick'

RSpec.describe Datadog::Profiling::Crashtracker do
before { skip_if_profiling_not_supported(self) }
before do
skip_if_profiling_not_supported(self)

crash_tracker_pids = `pgrep -f libdatadog-crashtracking-receiver`
expect(crash_tracker_pids).to be_empty, "No crash tracker process should be running, found #{crash_tracker_pids}"
end

let(:exporter_configuration) { [:agent, 'http://localhost:6006'] }

Expand Down

0 comments on commit 5431d2b

Please sign in to comment.