@@ -170,11 +170,11 @@ def test_simple_consumer__seek(self):
170
170
def test_simple_consumer_blocking (self ):
171
171
consumer = self .consumer ()
172
172
173
- # Ask for 5 messages, nothing in queue, block 5 seconds
173
+ # Ask for 5 messages, nothing in queue, block 1 second
174
174
with Timer () as t :
175
- messages = consumer .get_messages (block = True , timeout = 5 )
175
+ messages = consumer .get_messages (block = True , timeout = 1 )
176
176
self .assert_message_count (messages , 0 )
177
- self .assertGreaterEqual (t .interval , 5 )
177
+ self .assertGreaterEqual (t .interval , 1 )
178
178
179
179
self .send_messages (0 , range (0 , 10 ))
180
180
@@ -184,11 +184,11 @@ def test_simple_consumer_blocking(self):
184
184
self .assert_message_count (messages , 5 )
185
185
self .assertLessEqual (t .interval , 1 )
186
186
187
- # Ask for 10 messages, get 5 back, block 5 seconds
187
+ # Ask for 10 messages, get 5 back, block 1 second
188
188
with Timer () as t :
189
- messages = consumer .get_messages (count = 10 , block = True , timeout = 5 )
189
+ messages = consumer .get_messages (count = 10 , block = True , timeout = 1 )
190
190
self .assert_message_count (messages , 5 )
191
- self .assertGreaterEqual (t .interval , 5 )
191
+ self .assertGreaterEqual (t .interval , 1 )
192
192
193
193
consumer .stop ()
194
194
@@ -236,12 +236,12 @@ def test_multi_process_consumer(self):
236
236
def test_multi_process_consumer_blocking (self ):
237
237
consumer = self .consumer (consumer = MultiProcessConsumer )
238
238
239
- # Ask for 5 messages, No messages in queue, block 5 seconds
239
+ # Ask for 5 messages, No messages in queue, block 1 second
240
240
with Timer () as t :
241
- messages = consumer .get_messages (block = True , timeout = 5 )
241
+ messages = consumer .get_messages (block = True , timeout = 1 )
242
242
self .assert_message_count (messages , 0 )
243
243
244
- self .assertGreaterEqual (t .interval , 5 )
244
+ self .assertGreaterEqual (t .interval , 1 )
245
245
246
246
# Send 10 messages
247
247
self .send_messages (0 , range (0 , 10 ))
@@ -252,11 +252,11 @@ def test_multi_process_consumer_blocking(self):
252
252
self .assert_message_count (messages , 5 )
253
253
self .assertLessEqual (t .interval , 1 )
254
254
255
- # Ask for 10 messages, 5 in queue, block 5 seconds
255
+ # Ask for 10 messages, 5 in queue, block 1 second
256
256
with Timer () as t :
257
- messages = consumer .get_messages (count = 10 , block = True , timeout = 5 )
257
+ messages = consumer .get_messages (count = 10 , block = True , timeout = 1 )
258
258
self .assert_message_count (messages , 5 )
259
- self .assertGreaterEqual (t .interval , 4.95 )
259
+ self .assertGreaterEqual (t .interval , 1 )
260
260
261
261
consumer .stop ()
262
262
@@ -450,7 +450,7 @@ def test_kafka_consumer__blocking(self):
450
450
consumer = self .kafka_consumer (auto_offset_reset = 'smallest' ,
451
451
consumer_timeout_ms = TIMEOUT_MS )
452
452
453
- # Ask for 5 messages, nothing in queue, block 5 seconds
453
+ # Ask for 5 messages, nothing in queue, block 500ms
454
454
with Timer () as t :
455
455
with self .assertRaises (ConsumerTimeout ):
456
456
msg = consumer .next ()
@@ -467,7 +467,7 @@ def test_kafka_consumer__blocking(self):
467
467
self .assertEqual (len (messages ), 5 )
468
468
self .assertLess (t .interval , TIMEOUT_MS / 1000.0 )
469
469
470
- # Ask for 10 messages, get 5 back, block 5 seconds
470
+ # Ask for 10 messages, get 5 back, block 500ms
471
471
messages = set ()
472
472
with Timer () as t :
473
473
with self .assertRaises (ConsumerTimeout ):
0 commit comments