mirror of https://github.com/apache/kafka.git
HOTFIX: Revert async change in ProduceConsumeValidateTest
Author: Jason Gustafson <jason@confluent.io> Reviewers: Ismael Juma <ismael@juma.me.uk> Closes #1945 from hachikuji/hotfix-produce-consume-validate
This commit is contained in:
parent
20322446aa
commit
788989158a
|
|
@ -46,7 +46,7 @@ class ProduceConsumeValidateTest(Test):
|
||||||
def setup_producer_and_consumer(self):
|
def setup_producer_and_consumer(self):
|
||||||
raise NotImplementedError("Subclasses should implement this")
|
raise NotImplementedError("Subclasses should implement this")
|
||||||
|
|
||||||
def start_producer_and_consumer(self, async=False):
|
def start_producer_and_consumer(self):
|
||||||
# Start background producer and consumer
|
# Start background producer and consumer
|
||||||
self.consumer.start()
|
self.consumer.start()
|
||||||
if (self.consumer_init_timeout_sec > 0):
|
if (self.consumer_init_timeout_sec > 0):
|
||||||
|
|
@ -58,11 +58,11 @@ class ProduceConsumeValidateTest(Test):
|
||||||
self.consumer_init_timeout_sec)
|
self.consumer_init_timeout_sec)
|
||||||
|
|
||||||
self.producer.start()
|
self.producer.start()
|
||||||
wait_until(lambda: async or self.producer.num_acked > 5,
|
wait_until(lambda: self.producer.num_acked > 5,
|
||||||
timeout_sec=self.producer_start_timeout_sec,
|
timeout_sec=self.producer_start_timeout_sec,
|
||||||
err_msg="Producer failed to produce messages for %ds." %\
|
err_msg="Producer failed to produce messages for %ds." %\
|
||||||
self.producer_start_timeout_sec)
|
self.producer_start_timeout_sec)
|
||||||
wait_until(lambda: async or len(self.consumer.messages_consumed[1]) > 0,
|
wait_until(lambda: len(self.consumer.messages_consumed[1]) > 0,
|
||||||
timeout_sec=self.consumer_start_timeout_sec,
|
timeout_sec=self.consumer_start_timeout_sec,
|
||||||
err_msg="Consumer failed to consume messages for %ds." %\
|
err_msg="Consumer failed to consume messages for %ds." %\
|
||||||
self.consumer_start_timeout_sec)
|
self.consumer_start_timeout_sec)
|
||||||
|
|
@ -89,10 +89,10 @@ class ProduceConsumeValidateTest(Test):
|
||||||
self.producer.stop()
|
self.producer.stop()
|
||||||
self.consumer.wait()
|
self.consumer.wait()
|
||||||
|
|
||||||
def run_produce_consume_validate(self, async=False, core_test_action=None, *args):
|
def run_produce_consume_validate(self, core_test_action=None, *args):
|
||||||
"""Top-level template for simple produce/consume/validate tests."""
|
"""Top-level template for simple produce/consume/validate tests."""
|
||||||
try:
|
try:
|
||||||
self.start_producer_and_consumer(async)
|
self.start_producer_and_consumer()
|
||||||
|
|
||||||
if core_test_action is not None:
|
if core_test_action is not None:
|
||||||
core_test_action(*args)
|
core_test_action(*args)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue