(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestProduceSetAddingMessagesOverflowMessagesLimit(t *testing.T) { |
| 56 | parent, ps := makeProduceSet() |
| 57 | parent.conf.Producer.Flush.MaxMessages = 1000 |
| 58 | |
| 59 | msg := &ProducerMessage{Key: StringEncoder(TestMessage), Value: StringEncoder(TestMessage)} |
| 60 | |
| 61 | for i := range 1000 { |
| 62 | if ps.wouldOverflow(msg) { |
| 63 | t.Error("set shouldn't fill up after only", i+1, "messages") |
| 64 | } |
| 65 | safeAddMessage(t, ps, msg) |
| 66 | } |
| 67 | |
| 68 | if !ps.wouldOverflow(msg) { |
| 69 | t.Error("set should be full after 1000 messages") |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func TestProduceSetAddingMessagesOverflowBytesLimit(t *testing.T) { |
| 74 | parent, ps := makeProduceSet() |
nothing calls this directly
no test coverage detected