Skip to content

Commit dc91732

Browse files
authored
Add retry on bootstrap error in tests (#20575)
1 parent 53b2d96 commit dc91732

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ydb/tests/library/harness/kikimr_runner.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from . import kikimr_cluster_interface
2323

2424
import ydb.core.protos.blobstorage_config_pb2 as bs
25+
from ydb.public.api.protos.ydb_status_codes_pb2 import StatusIds
2526
from ydb.tests.library.predicates.blobstorage import blobstorage_controller_has_started_on_some_node
2627

2728

@@ -453,8 +454,15 @@ def _bootstrap_cluster(self, self_assembly_uuid="test-cluster", timeout=30, inte
453454
while time.time() - start_time < timeout:
454455
try:
455456
result = self.config_client.bootstrap_cluster(self_assembly_uuid=self_assembly_uuid)
456-
logger.info("Successfully bootstrapped cluster")
457-
return result
457+
if result.operation.status == StatusIds.SUCCESS:
458+
logger.info("Successfully bootstrapped cluster")
459+
return result
460+
else:
461+
error_msg = f"Bootstrap cluster failed with status: {result.operation.status}"
462+
for issue in result.operation.issues:
463+
error_msg += f"\nIssue: {issue}"
464+
raise Exception(error_msg)
465+
458466
except Exception as e:
459467
last_exception = e
460468
time.sleep(interval)

0 commit comments

Comments
 (0)