(t *testing.T)
| 86 | } |
| 87 | |
| 88 | func 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 | |
| 109 | func TestCombinerParallel(t *testing.T) { |
| 110 | // Ensure that the combiner is safe for parallel use. |
nothing calls this directly
no test coverage detected