Skip to content

Commit feda352

Browse files
dpkp88manpreet
authored andcommitted
Increase max_buffer_size for test_large_messages
1 parent 7ed8a79 commit feda352

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test_consumer_integration.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,14 @@ def test_large_messages(self):
360360
# Produce 10 messages that are large (bigger than default fetch size)
361361
large_messages = self.send_messages(0, [ random_string(5000) for x in range(10) ])
362362

363-
# Consumer should still get all of them
364-
consumer = self.consumer()
363+
# Brokers prior to 0.11 will return the next message
364+
# if it is smaller than max_bytes (called buffer_size in SimpleConsumer)
365+
# Brokers 0.11 and later that store messages in v2 format
366+
# internally will return the next message only if the
367+
# full MessageSet is smaller than max_bytes.
368+
# For that reason, we set the max buffer size to a little more
369+
# than the size of all large messages combined
370+
consumer = self.consumer(max_buffer_size=60000)
365371

366372
expected_messages = set(small_messages + large_messages)
367373
actual_messages = set([ x.message.value for x in consumer ])

0 commit comments

Comments
 (0)