From f51fc16c169ef2aac80eb572a6be74309e5605dd Mon Sep 17 00:00:00 2001 From: TengYao Chi Date: Tue, 24 Sep 2024 17:36:36 +0800 Subject: [PATCH] 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 --- tests/kafkatest/tests/core/reassign_partitions_test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/kafkatest/tests/core/reassign_partitions_test.py b/tests/kafkatest/tests/core/reassign_partitions_test.py index acacd20241ab8..d7c459bfb9cb3 100644 --- a/tests/kafkatest/tests/core/reassign_partitions_test.py +++ b/tests/kafkatest/tests/core/reassign_partitions_test.py @@ -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,