(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestProduceSetAddingMessagesOverflowBytesLimit(t *testing.T) { |
| 74 | parent, ps := makeProduceSet() |
| 75 | parent.conf.Producer.MaxMessageBytes = 1000 |
| 76 | |
| 77 | msg := &ProducerMessage{Key: StringEncoder(TestMessage), Value: StringEncoder(TestMessage)} |
| 78 | |
| 79 | for ps.bufferBytes+msg.ByteSize(2) < parent.conf.Producer.MaxMessageBytes { |
| 80 | if ps.wouldOverflow(msg) { |
| 81 | t.Error("set shouldn't fill up before 1000 bytes") |
| 82 | } |
| 83 | safeAddMessage(t, ps, msg) |
| 84 | } |
| 85 | |
| 86 | if !ps.wouldOverflow(msg) { |
| 87 | t.Error("set should be full after 1000 bytes") |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | func TestProduceSetPartitionTracking(t *testing.T) { |
| 92 | _, ps := makeProduceSet() |
nothing calls this directly
no test coverage detected