Using iter_timeout=0 for MP inner consumer in tests

This commit is contained in:
Viktor Shlapakov
2015-03-13 14:15:21 +03:00
parent f8012c1a74
commit e43f405a0c

View File

@@ -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)