From f4ebb2d82f19d7d4a3149355b365ef65c167f5d7 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Mon, 1 Jul 2024 09:27:18 +0100 Subject: [PATCH] Try looping waiting for process to see if it's just a delay --- spec/datadog/profiling/crashtracker_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/datadog/profiling/crashtracker_spec.rb b/spec/datadog/profiling/crashtracker_spec.rb index 59137e85efa..77879652454 100644 --- a/spec/datadog/profiling/crashtracker_spec.rb +++ b/spec/datadog/profiling/crashtracker_spec.rb @@ -8,8 +8,13 @@ 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}" + # No crash tracker process should still be running at the start of each testcase + wait_for { `pgrep -f libdatadog-crashtracking-receiver` }.to be_empty + end + + after do + # No crash tracker process should still be running at the end of each testcase + wait_for { `pgrep -f libdatadog-crashtracking-receiver` }.to be_empty end let(:exporter_configuration) { [:agent, 'http://localhost:6006'] }