Using iter_timeout=0 for MP inner consumer in tests
This commit is contained in:
@@ -63,6 +63,8 @@ class TestConsumerIntegration(KafkaIntegrationTestCase):
|
||||
|
||||
if consumer_class == SimpleConsumer:
|
||||
kwargs.setdefault('iter_timeout', 0)
|
||||
elif consumer_class == MultiProcessConsumer:
|
||||
kwargs.setdefault('simple_consumer_options', {'iter_timeout': 0})
|
||||
|
||||
return consumer_class(self.client, group, topic, **kwargs)
|
||||
|
||||
@@ -243,7 +245,8 @@ class TestConsumerIntegration(KafkaIntegrationTestCase):
|
||||
self.send_messages(0, range(0, 10))
|
||||
self.send_messages(1, range(10, 20))
|
||||
|
||||
consumer = MultiProcessConsumer(self.client, "group1", self.topic, auto_commit=False)
|
||||
consumer = MultiProcessConsumer(self.client, "group1", self.topic, auto_commit=False,
|
||||
simple_consumer_options={'iter_timeout': 0})
|
||||
|
||||
self.assertEqual(consumer.pending(), 20)
|
||||
self.assertEqual(consumer.pending(partitions=[0]), 10)
|
||||
|
||||
Reference in New Issue
Block a user