Skip to content

Commit 8e9f6cf

Browse files
authored
fix(testutil): fix tracing span collection (#324)
collect all spans if export spans is called more than once
1 parent e31bcd3 commit 8e9f6cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testutil/tracing.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Collector struct {
2525

2626
// ExportSpans receives the ReadOnlySpans from the batch provider
2727
func (c *Collector) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error {
28-
c.Spans = tracetest.SpanStubsFromReadOnlySpans(spans)
28+
c.Spans = append(c.Spans, tracetest.SpanStubsFromReadOnlySpans(spans)...)
2929
sort.SliceStable(c.Spans, func(i, j int) bool {
3030
return c.Spans[i].StartTime.Before(c.Spans[j].StartTime)
3131
})

0 commit comments

Comments
 (0)