KAFKA-17459 Stablize reassign_partitions_test.py (#17250)

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 <chia7712@gmail.com>
This commit is contained in:
TengYao Chi 2024-09-24 17:36:36 +08:00 committed by Chia-Ping Tsai
parent 64952756ff
commit 16e8f85466
1 changed files with 5 additions and 1 deletions

View File

@ -176,7 +176,11 @@ class ReassignPartitionsTest(ProduceConsumeValidateTest):
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,