Skip to content
Closed
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
9 changes: 9 additions & 0 deletions spec/datadog/tracing/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,15 @@ def agent_receives_span_step3(previous_success)

context 'executes only once' do
subject!(:multiple_shutdown) do
# Force the HTTP round-trip to take longer than DEFAULT_SHUTDOWN_TIMEOUT (1s).
# This reproduces the CI flakiness: the worker thread is mid-HTTP-call when
# shutdown! joins with a 1-second timeout, so join times out and
# traces_flushed is still 0 when the assertion runs.
allow(tracer.writer.transport).to receive(:send_traces).and_wrap_original do |original, *args|
sleep(2)
original.call(*args)
end

tracer.trace('my.short.op') do |span|
span.service = 'my.service'
end
Expand Down
Loading