MCPcopy
hub / github.com/grafana/tempo / TestGenericCombiner

Function TestGenericCombiner

modules/frontend/combiner/common_test.go:108–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

106}
107
108func TestGenericCombiner(t *testing.T) {
109 combiner := newTestCombiner()
110
111 wg := sync.WaitGroup{}
112
113 for i := 0; i < 10; i++ {
114 wg.Add(1)
115 go func() {
116 defer wg.Done()
117 for j := 0; j < 10000; j++ {
118
119 err := combiner.AddResponse(newTestResponse(t))
120 require.NoError(t, err)
121 }
122 }()
123 }
124
125 wg.Wait()
126 actual, err := combiner.finalize(nil)
127 require.NoError(t, err)
128
129 expected := 10 * 10000
130 require.Equal(t, expected, int(actual.SpanCount))
131 require.Equal(t, expected, int(actual.ErrorCount))
132}
133
134func TestGenericCombinerHoldsErrors(t *testing.T) {
135 // slam a combiner with successful responses and just one error. confirm that the error is returned

Callers

nothing calls this directly

Calls 7

newTestCombinerFunction · 0.85
newTestResponseFunction · 0.85
AddMethod · 0.65
DoneMethod · 0.65
AddResponseMethod · 0.65
WaitMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected