diff --git a/integration-tests/test_fluvio_python.py b/integration-tests/test_fluvio_python.py index cb9aabd..b0364c2 100644 --- a/integration-tests/test_fluvio_python.py +++ b/integration-tests/test_fluvio_python.py @@ -37,9 +37,18 @@ def common_setup(self, sm_path=None): try: self.admin.create_topic(self.topic) except Exception as err: - print("Retrying after create_topic error {}", err) - time.sleep(5) - self.admin.create_topic(self.topic) + print("create_topic error {}, will try to verify", err) + + # list topics to verify topic was created + max_retries = 100 + while max_retries > 0: + topic = self.admin.list_topics([self.topic]) + if len(topic) > 0: + break + max_retries -= 1 + if max_retries == 0: + self.fail("setup: Failed to create topic") + time.sleep(0.1) def setUp(self): self.common_setup() diff --git a/integration-tests/test_produce.py b/integration-tests/test_produce.py index cb17bcd..4ef5921 100644 --- a/integration-tests/test_produce.py +++ b/integration-tests/test_produce.py @@ -33,9 +33,7 @@ def common_setup(self, sm_path=None): try: self.admin.create_topic(self.topic) except Exception as err: - print("Retrying after create_topic error {}", err) - time.sleep(5) - self.admin.create_topic(self.topic) + print("create_topic error {}, will try to verify", err) # list topics to verify topic was created max_retries = 100