test.py: stop cluster if PythonSuite fails to start

If cluster fails to start, stop it.

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>
This commit is contained in:
Alejo Sanchez
2023-01-23 10:38:23 +01:00
parent dec0c1d9f6
commit a6059e4bb7

View File

@@ -859,7 +859,10 @@ class PythonTest(Test):
if self.is_before_test_ok is False:
print("Test {} pre-check failed: {}".format(self.name, str(e)))
print("Server log of the first server:\n{}".format(self.server_log))
# Don't try to continue if the cluster is broken
logger.info(f"Discarding cluster after failed start for test %s...", self.name)
await self.suite.clusters.steal()
await cluster.stop()
await cluster.release_ips()
cm.discard()
elif self.is_after_test_ok is False:
print("Test {} post-check failed: {}".format(self.name, str(e)))