From 240e153088538a3b91b4bd010883c7b9252aea9a Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Wed, 22 Dec 2021 10:55:05 -0800 Subject: [PATCH] fix(testutil): fix tracing span collection collect all spans if export spans is called more than once --- testutil/tracing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutil/tracing.go b/testutil/tracing.go index fd5e8a42..89630273 100644 --- a/testutil/tracing.go +++ b/testutil/tracing.go @@ -25,7 +25,7 @@ type Collector struct { // ExportSpans receives the ReadOnlySpans from the batch provider func (c *Collector) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error { - c.Spans = tracetest.SpanStubsFromReadOnlySpans(spans) + c.Spans = append(c.Spans, tracetest.SpanStubsFromReadOnlySpans(spans)...) sort.SliceStable(c.Spans, func(i, j int) bool { return c.Spans[i].StartTime.Before(c.Spans[j].StartTime) })