varshini03 commented on code in PR #23236:
URL: https://github.com/apache/kafka/pull/23236#discussion_r3992567636


##########
tests/kafkatest/services/verifiable_producer.py:
##########
@@ -111,6 +113,26 @@ def __init__(self, context, num_nodes, kafka, topic, 
max_messages=-1, throughput
     def java_class_name(self):
         return "VerifiableProducer"
 
+    def start(self, **kwargs):
+        super(VerifiableProducer, self).start(**kwargs)
+        timeout_sec = kwargs.get("timeout_sec", 120)
+        wait_until(
+            lambda: len(self.started_nodes()) == len(self.nodes) or 
self._propagate_exceptions(),
+            timeout_sec=timeout_sec,
+            err_msg="Verifiable producer didn't finish startup in %d seconds" 
% timeout_sec
+        )
+
+    def _handle_startup_complete(self, node):
+        """Called when a producer node emits the startup_complete event."""
+        with self.lock:
+            self._started_nodes_set.add(node)

Review Comment:
   Thanks for the feedback! To address both questions:
   
   The intent of started_nodes() is to track "nodes that have completed 
startup", "currently running nodes".
   I also noticed https://github.com/apache/kafka/pull/23366/changes takes the 
same semantic approach for VerifiableConsumer and renames it to 
startup_complete_nodes for clarity. Happy to do the same rename here, let me 
know if that's preferred then?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to