properly fail when KafkaIntegrationTestCase.wait_kafka never succeeds
@@ -120,9 +120,7 @@ class KafkaIntegrationTestCase(unittest.TestCase):
cls.hosts = ['{}:{}'.format(cls.kafka_host, cls.kafka_port)]
# Reconnecting until Kafka in docker becomes available
- client = AIOKafkaClient(
- loop=cls.loop, bootstrap_servers=cls.hosts)
-
+ client = AIOKafkaClient(loop=cls.loop, bootstrap_servers=cls.hosts)
for i in range(500):
try:
cls.loop.run_until_complete(client.bootstrap())
@@ -134,7 +132,8 @@ class KafkaIntegrationTestCase(unittest.TestCase):
time.sleep(0.1)
else:
cls.loop.run_until_complete(client.close())
- break
+ return
+ assert False, "Kafka server never started"
def setUp(self):
super().setUp()
