File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,25 @@ def test_offset_behavior__resuming_behavior(self):
240
240
consumer1 .stop ()
241
241
consumer2 .stop ()
242
242
243
+ # TODO: Make this a unit test -- should not require integration
244
+ @kafka_versions ("all" )
245
+ def test_fetch_buffer_size (self ):
246
+
247
+ # Test parameters (see issue 135 / PR 136)
248
+ TEST_MESSAGE_SIZE = 1048
249
+ INIT_BUFFER_SIZE = 1024
250
+ MAX_BUFFER_SIZE = 2048
251
+ assert TEST_MESSAGE_SIZE > INIT_BUFFER_SIZE
252
+ assert TEST_MESSAGE_SIZE < MAX_BUFFER_SIZE
253
+ assert MAX_BUFFER_SIZE == 2 * INIT_BUFFER_SIZE
254
+
255
+ self .send_messages (0 , [ "x" * 1048 ])
256
+ self .send_messages (1 , [ "x" * 1048 ])
257
+
258
+ consumer = self .consumer (buffer_size = 1024 , max_buffer_size = 2048 )
259
+ messages = [ message for message in consumer ]
260
+ self .assertEquals (len (messages ), 2 )
261
+
243
262
def consumer (self , ** kwargs ):
244
263
if os .environ ['KAFKA_VERSION' ] == "0.8.0" :
245
264
# Kafka 0.8.0 simply doesn't support offset requests, so hard code it being off
You can’t perform that action at this time.
0 commit comments