MINOR: improve test stability for Streams broker-compatibility test
Author: Matthias J. Sax
Reviewers: Magnus Edenhill, Eno Thereska, Damian Guy, Guozhang Wang
Closes from mjsax/minor-broker-comp-test
from ducktape.mark import parametrize
from ducktape.tests.test import Test
+from ducktape.utils.util import wait_until
from kafkatest.services.kafka import KafkaService
from kafkatest.services.streams import StreamsBrokerCompatibilityService
@@ -66,14 +67,11 @@ class StreamsBrokerCompatibility(Test):
self.processor.wait()
- num_consumed_mgs = self.consumer.total_consumed()
+ wait_until(lambda: self.consumer.total_consumed() > 0, timeout_sec=30, err_msg="Did expect to read a message but got none within 30 seconds.")
self.consumer.stop()
self.kafka.stop()
- assert num_consumed_mgs == 1, \
- "Did expect to read exactly one message but got %d" % num_consumed_mgs
-
@parametrize(broker_version=str(LATEST_0_10_0))
def test_fail_fast_on_incompatible_brokers(self, broker_version):
self.kafka.set_version(KafkaVersion(broker_version))
