(t *testing.T)
| 65 | } |
| 66 | |
| 67 | func TestCombinerChecksMaxBytes(t *testing.T) { |
| 68 | // Ensure that the combiner checks max bytes when consuming a trace. |
| 69 | for _, maxBytes := range []int{0, 100, 1000, 10000} { |
| 70 | c := NewCombiner(maxBytes, false) |
| 71 | curSize := 0 |
| 72 | |
| 73 | // attempt up to 20 traces to exceed max bytes |
| 74 | for i := 0; i < 20; i++ { |
| 75 | tr := test.MakeTraceWithSpanCount(1, 1, []byte{0x01}) |
| 76 | curSize += tr.Size() |
| 77 | |
| 78 | _, err := c.Consume(tr) |
| 79 | if curSize > maxBytes && maxBytes != 0 { |
| 80 | require.Error(t, err) |
| 81 | continue |
| 82 | } |
| 83 | require.NoError(t, err) |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestCombinerReturnsAPartialTrace(t *testing.T) { |
| 89 | // Ensure that the combiner checks max bytes when consuming a trace. |
nothing calls this directly
no test coverage detected