Skip to content

Commit f7e85f9

Browse files
authored
Merge pull request #4692 from DataDog/ivoanjo/maybe-fix-flaky-scheduler-spec
[NO-TICKET] Attempt to fix flaky profiler spec under test-memcheck
2 parents ff8ae5b + b09b301 commit f7e85f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/datadog/profiling/scheduler_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@
284284
allow(exporter).to receive(:flush).and_return(flush)
285285
end
286286

287+
after do
288+
scheduler.stop(true) if instance_variable_defined?(:@stopped) && !@stopped
289+
end
290+
287291
# This test validates the behavior of the @stop_requested flag.
288292
#
289293
# Specifically, the looping behavior we get from the core helpers will keep on trying to flush
@@ -296,7 +300,9 @@
296300
scheduler.start
297301
wait_for { scheduler.run_loop? }.to be true
298302

299-
expect(scheduler.stop).to be true
303+
@stopped = false
304+
expect(scheduler.stop(false, 10)).to be true
305+
@stopped = true
300306
end
301307
end
302308
end

0 commit comments

Comments
 (0)