Skip to content

Commit

Permalink
[ART-380] Fix tracer leaving background writer threads
Browse files Browse the repository at this point in the history
This was causing a race in
`bundle exec rspec --seed 50224 spec/ddtrace/tracer_integration_spec.rb`
exposing the issue in ART-380 where multiple writer background threads
would trigger initialization of metrics.

This does not fix the underlying issue causing
`ArgumentError: wrong number of arguments (given 2, expected 0)`
(see next commit for that).
  • Loading branch information
ivoanjo committed Feb 5, 2021
1 parent ba25f37 commit cb34e2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/ddtrace/tracer_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
subject(:tracer) { described_class.new(writer: FauxWriter.new) }
let(:spans) { tracer.writer.spans(:keep) }

after do
tracer.shutdown! # Ensure no state gets left behind
end

def sampling_priority_metric(span)
span.get_metric(Datadog::Ext::DistributedTracing::SAMPLING_PRIORITY_KEY)
end
Expand Down

0 comments on commit cb34e2b

Please sign in to comment.