File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -352,8 +352,14 @@ def test_large_messages(self):
352
352
# Produce 10 messages that are large (bigger than default fetch size)
353
353
large_messages = self .send_messages (0 , [ random_string (5000 ) for x in range (10 ) ])
354
354
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 )
357
363
358
364
expected_messages = set (small_messages + large_messages )
359
365
actual_messages = set ([ x .message .value for x in consumer ])
You can’t perform that action at this time.
0 commit comments