Skip to content

Commit

Permalink
KAFKA-17459 Stablize reassign_partitions_test.py (apache#17250)
Browse files Browse the repository at this point in the history
This test expects that each partition can receive the record, so using a non-null key helps distribute the records more randomly.

Reviewers: Chia-Ping Tsai <[email protected]>
  • Loading branch information
frankvicky authored Sep 24, 2024
1 parent 42cc3c0 commit f51fc16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/kafkatest/tests/core/reassign_partitions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ def test_reassign_partitions(self, bounce_brokers, reassign_from_offset_zero, me
self.producer = VerifiableProducer(self.test_context, self.num_producers,
self.kafka, self.topic,
throughput=self.producer_throughput,
enable_idempotence=True)
enable_idempotence=True,
# This test aims to verify the reassignment without failure, assuming that all partitions have data.
# To avoid the reassignment behavior being affected by the `BuiltInPartitioner` (due to the key not being set),
# we set a key for the message to ensure both even data distribution across all partitions.
repeating_keys=100)
self.consumer = ConsoleConsumer(self.test_context, self.num_consumers,
self.kafka, self.topic,
consumer_timeout_ms=60000,
Expand Down

0 comments on commit f51fc16

Please sign in to comment.