You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lianetm (via GitHub)" <gi...@apache.org> on 2026/09/03 15:54:59 UTC
Re: [PR] KAFKA-20455: wait for all producers to send startup_complete before executing system tests [kafka]
lianetm commented on code in PR #23236:
URL: https://github.com/apache/kafka/pull/23236#discussion_r3926221226
##########
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:
should we close the lifecycle and remove the node from the `started_nodes` set at some point? e.g., on kill_node maybe?
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org