diff options
author | Dana Powers <dana.powers@rd.io> | 2014-09-01 17:24:50 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2014-09-04 18:05:05 -0700 |
commit | 1b282d21522d101f4129d5fc3e70e2b904d3b171 (patch) | |
tree | d559e3c3f650dab1ce9247aa7a89f41bdd410e46 /test/test_failover_integration.py | |
parent | b0f85932216ddd4083b67a5e0595636f4d7b25ce (diff) | |
download | kafka-python-1b282d21522d101f4129d5fc3e70e2b904d3b171.tar.gz |
Cleanup tests: no more import *; remove unused
Diffstat (limited to 'test/test_failover_integration.py')
-rw-r--r-- | test/test_failover_integration.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/test_failover_integration.py b/test/test_failover_integration.py index 51b791f..5e737b0 100644 --- a/test/test_failover_integration.py +++ b/test/test_failover_integration.py @@ -4,7 +4,7 @@ import time import unittest2 from kafka import KafkaClient, SimpleConsumer -from kafka.common import TopicAndPartition, FailedPayloadsError +from kafka.common import TopicAndPartition, FailedPayloadsError, ConnectionError from kafka.producer import Producer from test.fixtures import ZookeeperFixture, KafkaFixture @@ -45,7 +45,6 @@ class TestFailover(KafkaIntegrationTestCase): @kafka_versions("all") def test_switch_leader(self): - key = random_string(5) topic = self.topic partition = 0 @@ -57,7 +56,7 @@ class TestFailover(KafkaIntegrationTestCase): self._send_random_messages(producer, topic, partition, 100) # kill leader for partition - broker = self._kill_leader(topic, partition) + self._kill_leader(topic, partition) # expect failure, but dont wait more than 60 secs to recover recovered = False @@ -87,7 +86,6 @@ class TestFailover(KafkaIntegrationTestCase): #@kafka_versions("all") @unittest2.skip("async producer does not support reliable failover yet") def test_switch_leader_async(self): - key = random_string(5) topic = self.topic partition = 0 @@ -98,7 +96,7 @@ class TestFailover(KafkaIntegrationTestCase): self._send_random_messages(producer, topic, partition, 10) # kill leader for partition - broker = self._kill_leader(topic, partition) + self._kill_leader(topic, partition) logging.debug("attempting to send 'success' message after leader killed") @@ -115,8 +113,7 @@ class TestFailover(KafkaIntegrationTestCase): # count number of messages # Should be equal to 10 before + 1 recovery + 10 after - count = self.assert_message_count(topic, 21, partitions=(partition,)) - + self.assert_message_count(topic, 21, partitions=(partition,)) def _send_random_messages(self, producer, topic, partition, n): for j in range(n): |