Skip to content

Commit

Permalink
Keep everything to sucker_punch test file.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahchen6 committed Feb 7, 2025
1 parent cd45c06 commit e02ad49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 4 additions & 0 deletions spec/datadog/tracing/contrib/sucker_punch/patcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def perform(action = :none, **_)
end
end

def get_spans_count(tracer = self.tracer)
fetch_traces(tracer).sum { |trace| trace.spans.length }
end

context 'successful job' do
subject(:dummy_worker_success) { worker_class.perform_async }

Expand Down
9 changes: 0 additions & 9 deletions spec/datadog/tracing/contrib/support/tracer_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ def fetch_spans(tracer = self.tracer)
end
end

def get_spans_count(tracer = self.tracer)
count = 0
traces = fetch_traces(tracer)
traces.each do |trace|
count += trace.instance_variable_get(:@spans).length
end
count
end

# Remove all traces from the current tracer instance and
# busts cache of +#spans+ and +#span+.
def clear_traces!
Expand Down

0 comments on commit e02ad49

Please sign in to comment.