squah-confluent commented on code in PR #23236:
URL: https://github.com/apache/kafka/pull/23236#discussion_r3940709267
##########
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:
I think we need to decide what `started_nodes` returns. Do we want the nodes
that have completed startup or the nodes currently running?
There is a related bug in `VerifiableConsumer` when starting consumers that
are expected to die from fencing. Sometimes the consumers die too quickly and
they are never simultaneously running, so we time out on startup. There is a
fix in progress at #23366.
--
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]