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

Function TestCombinerReturnsAPartialTrace

pkg/model/trace/combine_test.go:88–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestCombinerReturnsAPartialTrace(t *testing.T) {
89 // Ensure that the combiner checks max bytes when consuming a trace.
90 for _, maxBytes := range []int{0, 100, 1000, 10000} {
91 c := NewCombiner(maxBytes, true)
92 curSize := 0
93
94 // attempt up to 20 traces to exceed max bytes
95 for i := 0; i < 20; i++ {
96 tr := test.MakeTraceWithSpanCount(1, 1, []byte{0x01})
97 curSize += tr.Size()
98
99 _, err := c.Consume(tr)
100 if curSize > maxBytes && maxBytes != 0 {
101 require.NoError(t, err)
102 continue
103 }
104 require.NoError(t, err)
105 }
106 }
107}
108
109func TestCombinerParallel(t *testing.T) {
110 // Ensure that the combiner is safe for parallel use.

Callers

nothing calls this directly

Calls 4

ConsumeMethod · 0.95
MakeTraceWithSpanCountFunction · 0.92
NewCombinerFunction · 0.70
SizeMethod · 0.65

Tested by

no test coverage detected