Skip to content

Commit bb731eb

Browse files
author
Dana Powers
committed
Add more comments to test_switch_leader regarding req_acks policy
1 parent 01f7c0d commit bb731eb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/test_failover_integration.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,18 @@ def test_switch_leader(self):
5050
topic = self.topic
5151
partition = 0
5252

53-
# Test the base class Producer -- send_messages to a specific partition
53+
# Testing the base Producer class here so that we can easily send
54+
# messages to a specific partition, kill the leader for that partition
55+
# and check that after another broker takes leadership the producer
56+
# is able to resume sending messages
57+
58+
# require that the server commit messages to all in-sync replicas
59+
# so that failover doesn't lose any messages on server-side
60+
# and we can assert that server-side message count equals client-side
5461
producer = Producer(self.client, async=False,
5562
req_acks=Producer.ACK_AFTER_CLUSTER_COMMIT)
5663

57-
# Send 10 random messages
64+
# Send 100 random messages to a specific partition
5865
self._send_random_messages(producer, topic, partition, 100)
5966

6067
# kill leader for partition
@@ -81,7 +88,7 @@ def test_switch_leader(self):
8188
self._send_random_messages(producer, topic, partition, 100)
8289

8390
# count number of messages
84-
# Should be equal to 10 before + 1 recovery + 10 after
91+
# Should be equal to 100 before + 1 recovery + 100 after
8592
self.assert_message_count(topic, 201, partitions=(partition,))
8693

8794

0 commit comments

Comments
 (0)