summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2017-02-28 20:13:28 +0200
committerDana Powers <dana.powers@gmail.com>2017-02-28 10:13:28 -0800
commit432f00eb669550c75fa75e8efa56d5d80cda18a5 (patch)
treef52c04dc061b9d70d8fe435483391bbebbd4a2e3 /test
parentbcb4009b935fb74e3ca71206466c68ad74bc7b3c (diff)
downloadkafka-python-432f00eb669550c75fa75e8efa56d5d80cda18a5.tar.gz
Fail-fast on timeout constraint violations during KafkaConsumer creation (#986)
Diffstat (limited to 'test')
-rw-r--r--test/test_consumer.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_consumer.py b/test/test_consumer.py
index f3dad16..073a3af 100644
--- a/test/test_consumer.py
+++ b/test/test_consumer.py
@@ -16,6 +16,14 @@ class TestKafkaConsumer(unittest.TestCase):
with self.assertRaises(AssertionError):
SimpleConsumer(MagicMock(), 'group', 'topic', partitions = [ '0' ])
+ def test_session_timeout_larger_than_request_timeout_raises(self):
+ with self.assertRaises(KafkaConfigurationError):
+ KafkaConsumer(bootstrap_servers='localhost:9092', session_timeout_ms=60000, request_timeout_ms=40000)
+
+ def test_fetch_max_wait_larger_than_request_timeout_raises(self):
+ with self.assertRaises(KafkaConfigurationError):
+ KafkaConsumer(bootstrap_servers='localhost:9092', fetch_max_wait_ms=41000, request_timeout_ms=40000)
+
class TestMultiProcessConsumer(unittest.TestCase):
@unittest.skipIf(sys.platform.startswith('win'), 'test mocking fails on windows')