summaryrefslogtreecommitdiff
path: root/test/test_failover_integration.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@rd.io>2015-02-08 10:49:23 -0800
committerDana Powers <dana.powers@rd.io>2015-02-09 10:34:19 -0800
commitbb731eb89cc58c2e6799ff2223c47011594986f1 (patch)
treeb83cd9de9bd0e5c050e7446ebde189df1b64e85a /test/test_failover_integration.py
parent01f7c0d176e8430d3a117f7ca90b6853f937c5c3 (diff)
downloadkafka-python-bb731eb89cc58c2e6799ff2223c47011594986f1.tar.gz
Add more comments to test_switch_leader regarding req_acks policy
Diffstat (limited to 'test/test_failover_integration.py')
-rw-r--r--test/test_failover_integration.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/test_failover_integration.py b/test/test_failover_integration.py
index 167a231..7d27526 100644
--- a/test/test_failover_integration.py
+++ b/test/test_failover_integration.py
@@ -50,11 +50,18 @@ class TestFailover(KafkaIntegrationTestCase):
topic = self.topic
partition = 0
- # Test the base class Producer -- send_messages to a specific partition
+ # Testing the base Producer class here so that we can easily send
+ # messages to a specific partition, kill the leader for that partition
+ # and check that after another broker takes leadership the producer
+ # is able to resume sending messages
+
+ # require that the server commit messages to all in-sync replicas
+ # so that failover doesn't lose any messages on server-side
+ # and we can assert that server-side message count equals client-side
producer = Producer(self.client, async=False,
req_acks=Producer.ACK_AFTER_CLUSTER_COMMIT)
- # Send 10 random messages
+ # Send 100 random messages to a specific partition
self._send_random_messages(producer, topic, partition, 100)
# kill leader for partition
@@ -81,7 +88,7 @@ class TestFailover(KafkaIntegrationTestCase):
self._send_random_messages(producer, topic, partition, 100)
# count number of messages
- # Should be equal to 10 before + 1 recovery + 10 after
+ # Should be equal to 100 before + 1 recovery + 100 after
self.assert_message_count(topic, 201, partitions=(partition,))