Skip to content

Commit

Permalink
re-add spans using splat operator (#1580)
Browse files Browse the repository at this point in the history
  • Loading branch information
plantfansam authored Jan 24, 2024
1 parent 45f9c08 commit 4b37bb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def force_flush(timeout: nil) # rubocop:disable Metrics/MethodLength
dropped_spans = snapshot.shift(n)
report_dropped_spans(dropped_spans, reason: 'buffer-full', function: __method__.to_s)
end
spans.unshift(snapshot) unless snapshot.empty?
spans.unshift(*snapshot) unless snapshot.empty?
@condition.signal if spans.size > max_queue_size / 2
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,15 @@ def to_span_data
test_exporter = TestExporter.new
bsp = BatchSpanProcessor.new(test_exporter)
bsp.on_finish(TestSpan.new)
bsp.on_finish(TestSpan.new)
result = bsp.force_flush(timeout: 0)

_(result).must_equal(TIMEOUT)

_(test_exporter.failed_batches.size).must_equal(0)
_(test_exporter.batches.size).must_equal(0)

_(bsp.instance_variable_get(:@spans).size).must_equal(1)
_(bsp.instance_variable_get(:@spans).size).must_equal(2)
end
end

Expand Down

0 comments on commit 4b37bb3

Please sign in to comment.