FrankYang0529 commented on code in PR #18768:
URL: https://github.com/apache/kafka/pull/18768#discussion_r1938206038


##########
tests/kafkatest/sanity_checks/test_verifiable_producer.py:
##########
@@ -32,25 +31,21 @@ def __init__(self, test_context):
         super(TestVerifiableProducer, self).__init__(test_context)
 
         self.topic = "topic"
-        self.zk = ZookeeperService(test_context, num_nodes=1) if 
quorum.for_test(test_context) == quorum.zk else None
-        self.kafka = KafkaService(test_context, num_nodes=1, zk=self.zk,
+        self.kafka = KafkaService(test_context, num_nodes=1, zk=None,
                                   topics={self.topic: {"partitions": 1, 
"replication-factor": 1}})
 
         self.num_messages = 1000
         # This will produce to source kafka cluster
         self.producer = VerifiableProducer(test_context, num_nodes=1, 
kafka=self.kafka, topic=self.topic,
                                            max_messages=self.num_messages, 
throughput=self.num_messages // 10)
-    def setUp(self):
-        if self.zk:
-            self.zk.start()
 
     @cluster(num_nodes=3)
-    @matrix(producer_version=[str(DEV_BRANCH)], acks=["0", "1", "-1"], 
enable_idempotence=[False])
-    @matrix(producer_version=[str(DEV_BRANCH)], acks=["-1"], 
enable_idempotence=[True])
-    @matrix(producer_version=[str(DEV_BRANCH)], 
security_protocol=['PLAINTEXT', 'SSL'], metadata_quorum=quorum.all)
+    @matrix(producer_version=[str(DEV_BRANCH)], acks=["0", "1", "-1"], 
enable_idempotence=[False], metadata_quorum=quorum.all_kraft)
+    @matrix(producer_version=[str(DEV_BRANCH)], acks=["-1"], 
enable_idempotence=[True], metadata_quorum=quorum.all_kraft)
+    @matrix(producer_version=[str(DEV_BRANCH)], 
security_protocol=['PLAINTEXT', 'SSL'], metadata_quorum=quorum.all_kraft)
     @cluster(num_nodes=4)

Review Comment:
   Update all test cases to 4 nodes. If using three nodes, it shows error like 
this:
   
   ```
   [INFO:2025-01-31 21:10:51,156]: RunnerClient: 
kafkatest.sanity_checks.test_verifiable_producer.TestVerifiableProducer.test_simple_run.producer_version=dev.security_protocol=SASL_SSL.sasl_mechanism=PLAIN.metadata_quorum=ISOLATED_KRAFT:
 FAIL: InsufficientResourcesError('linux nodes requested: 1. linux nodes 
available: 0')
   Traceback (most recent call last):
     File 
"/usr/local/lib/python3.7/dist-packages/ducktape/tests/runner_client.py", line 
351, in _do_run
       data = self.run_test()
     File 
"/usr/local/lib/python3.7/dist-packages/ducktape/tests/runner_client.py", line 
411, in run_test
       return self.test_context.function(self.test)
     File "/usr/local/lib/python3.7/dist-packages/ducktape/mark/_mark.py", line 
438, in wrapper
       return functools.partial(f, *args, **kwargs)(*w_args, **w_kwargs)
     File 
"/opt/kafka-dev/tests/kafkatest/sanity_checks/test_verifiable_producer.py", 
line 64, in test_simple_run
       self.kafka.start()
     File "/opt/kafka-dev/tests/kafkatest/services/kafka/kafka.py", line 637, 
in start
       self.start_minikdc_if_necessary(add_principals)
     File "/opt/kafka-dev/tests/kafkatest/services/kafka/kafka.py", line 603, 
in start_minikdc_if_necessary
       self.minikdc = MiniKdc(self.context, nodes_for_kdc, extra_principals = 
add_principals)
     File "/opt/kafka-dev/tests/kafkatest/services/security/minikdc.py", line 
74, in __init__
       super(MiniKdc, self).__init__(context, 1)
     File 
"/usr/local/lib/python3.7/dist-packages/ducktape/services/service.py", line 
107, in __init__
       self.allocate_nodes()
     File 
"/usr/local/lib/python3.7/dist-packages/ducktape/services/service.py", line 
217, in allocate_nodes
       self.nodes = self.cluster.alloc(self.cluster_spec)
     File "/usr/local/lib/python3.7/dist-packages/ducktape/cluster/cluster.py", 
line 54, in alloc
       allocated = self.do_alloc(cluster_spec)
     File 
"/usr/local/lib/python3.7/dist-packages/ducktape/cluster/finite_subcluster.py", 
line 37, in do_alloc
       good_nodes, bad_nodes = self._available_nodes.remove_spec(cluster_spec)
     File 
"/usr/local/lib/python3.7/dist-packages/ducktape/cluster/node_container.py", 
line 129, in remove_spec
       raise InsufficientResourcesError(err)
   ducktape.cluster.node_container.InsufficientResourcesError: linux nodes 
requested: 1. linux nodes available: 0
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to