@@ -49,45 +49,6 @@ func TestMultiSpanProcessorMultiplexing(t *testing.T) {
4949 }
5050}
5151
52- func TestMultiSpanProcessorSomeNotOk (t * testing.T ) {
53- processors := make ([]SpanProcessor , 3 )
54- for i := range processors {
55- processors [i ] = & mockSpanProcessor {}
56- }
57-
58- // Make one processor return false for some spans
59- m := processors [1 ].(* mockSpanProcessor )
60- wantFailures := uint64 (2 )
61- m .Failures = wantFailures
62-
63- tt := NewMultiSpanProcessor (processors )
64- spans := make ([]* tracepb.Span , wantFailures + 3 )
65- for i := range spans {
66- spans [i ] = & tracepb.Span {}
67- }
68- td := data.TraceData {
69- Spans : spans ,
70- }
71-
72- var wantSpansCount = 0
73- for i := 0 ; i < 2 ; i ++ {
74- failures , _ := tt .ProcessSpans (td , "test" )
75- batchSize := len (td .Spans )
76- wantSpansCount += batchSize
77- if wantFailures != failures {
78- t .Errorf ("Wanted %d failures but got %d" , wantFailures , failures )
79- }
80- }
81-
82- for _ , p := range processors {
83- m := p .(* mockSpanProcessor )
84- if m .TotalSpans != wantSpansCount {
85- t .Errorf ("Wanted %d for every processor but got %d" , wantSpansCount , m .TotalSpans )
86- return
87- }
88- }
89- }
90-
9152func TestMultiSpanProcessorWhenOneErrors (t * testing.T ) {
9253 processors := make ([]SpanProcessor , 3 )
9354 for i := range processors {
@@ -105,16 +66,13 @@ func TestMultiSpanProcessorWhenOneErrors(t *testing.T) {
10566
10667 var wantSpansCount = 0
10768 for i := 0 ; i < 2 ; i ++ {
108- failures , err := tt .ProcessSpans (td , "test" )
69+ err := tt .ProcessSpans (td , "test" )
10970 if err == nil {
11071 t .Errorf ("Wanted error got nil" )
11172 return
11273 }
11374 batchSize := len (td .Spans )
11475 wantSpansCount += batchSize
115- if failures != uint64 (batchSize ) {
116- t .Errorf ("Wanted all spans to fail, got a different value." )
117- }
11876 }
11977
12078 for _ , p := range processors {
@@ -233,19 +191,18 @@ func multiSpanProcessorWithAddAttributesTestHelper(t *testing.T, overwrite bool)
233191}
234192
235193type mockSpanProcessor struct {
236- Failures uint64
237194 TotalSpans int
238195 MustFail bool
239196}
240197
241198var _ SpanProcessor = & mockSpanProcessor {}
242199
243- func (p * mockSpanProcessor ) ProcessSpans (td data.TraceData , spanFormat string ) ( uint64 , error ) {
200+ func (p * mockSpanProcessor ) ProcessSpans (td data.TraceData , spanFormat string ) error {
244201 batchSize := len (td .Spans )
245202 p .TotalSpans += batchSize
246203 if p .MustFail {
247- return uint64 ( batchSize ), fmt .Errorf ("this processor must fail" )
204+ return fmt .Errorf ("this processor must fail" )
248205 }
249206
250- return p . Failures , nil
207+ return nil
251208}
0 commit comments