Skip to content

Commit c5f1c69

Browse files
committed
Increase max_buffer_size for test_large_messages
1 parent b4f7122 commit c5f1c69

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
@@ -352,8 +352,14 @@ def test_large_messages(self):
352352
# Produce 10 messages that are large (bigger than default fetch size)
353353
large_messages = self.send_messages(0, [ random_string(5000) for x in range(10) ])
354354

355-
# Consumer should still get all of them
356-
consumer = self.consumer()
355+
# Brokers prior to 0.11 will return the next message
356+
# if it is smaller than max_bytes (called buffer_size in SimpleConsumer)
357+
# Brokers 0.11 and later that store messages in v2 format
358+
# internally will return the next message only if the
359+
# full MessageSet is smaller than max_bytes.
360+
# For that reason, we set the max buffer size to a little more
361+
# than the size of all large messages combined
362+
consumer = self.consumer(max_buffer_size=60000)
357363

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

0 commit comments

Comments
 (0)