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
7 changes: 7 additions & 0 deletions spec/datadog/tracing/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,13 @@ def agent_receives_span_step3(previous_success)
span.service = 'my.service'
end

# The background worker flushes nearly instantly (DEFAULT_FLUSH_INTERVAL
# is stubbed to 0), so the trace is almost always already flushed before
# shutdown threads start. Make that deterministic to avoid flakiness when
# the 1-second DEFAULT_SHUTDOWN_TIMEOUT is occasionally too short for the
# HTTP round-trip under CI load.
try_wait_until { tracer.writer.stats[:traces_flushed] >= 1 }

threads = Array.new(10) do
Thread.new { tracer.shutdown! }
end
Expand Down
Loading