Skip to content

Commit 4b37bb3

Browse files
authored
re-add spans using splat operator (#1580)
1 parent 45f9c08 commit 4b37bb3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sdk/lib/opentelemetry/sdk/trace/export/batch_span_processor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def force_flush(timeout: nil) # rubocop:disable Metrics/MethodLength
125125
dropped_spans = snapshot.shift(n)
126126
report_dropped_spans(dropped_spans, reason: 'buffer-full', function: __method__.to_s)
127127
end
128-
spans.unshift(snapshot) unless snapshot.empty?
128+
spans.unshift(*snapshot) unless snapshot.empty?
129129
@condition.signal if spans.size > max_queue_size / 2
130130
end
131131
end

sdk/test/opentelemetry/sdk/trace/export/batch_span_processor_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,15 @@ def to_span_data
201201
test_exporter = TestExporter.new
202202
bsp = BatchSpanProcessor.new(test_exporter)
203203
bsp.on_finish(TestSpan.new)
204+
bsp.on_finish(TestSpan.new)
204205
result = bsp.force_flush(timeout: 0)
205206

206207
_(result).must_equal(TIMEOUT)
207208

208209
_(test_exporter.failed_batches.size).must_equal(0)
209210
_(test_exporter.batches.size).must_equal(0)
210211

211-
_(bsp.instance_variable_get(:@spans).size).must_equal(1)
212+
_(bsp.instance_variable_get(:@spans).size).must_equal(2)
212213
end
213214
end
214215

0 commit comments

Comments
 (0)