Skip to content

Commit 3029fcb

Browse files
authored
check if nodes restart while benchmark (#9166)
1 parent e8c9cca commit 3029fcb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ydb/tests/olap/lib/ydb_cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def _try_extract_error_message(stderr: str) -> str:
8282
if wait_error is not None:
8383
return YdbCliHelper.WorkloadRunResult(error_message=f'Ydb cluster is dead: {wait_error}')
8484

85+
cluster_start_time = YdbCluster.get_cluster_info().get('max_start_time', 0)
86+
8587
json_path = yatest.common.work_path(f'q{query_num}.json')
8688
qout_path = yatest.common.work_path(f'q{query_num}.out')
8789
plan_path = yatest.common.work_path(f'q{query_num}.plan')
@@ -111,6 +113,8 @@ def _try_extract_error_message(stderr: str) -> str:
111113
err = f'Invalid return code: {exec.returncode} instesd 0.'
112114
except (yatest.common.process.TimeoutError, yatest.common.process.ExecutionTimeoutError):
113115
err = f'Timeout {timeout}s expeared.'
116+
if YdbCluster.get_cluster_info().get('max_start_time', 0) != cluster_start_time:
117+
err = ('' if err is None else f'{err}\n\n') + 'Some nodes were restart'
114118
stats = {}
115119
if (os.path.exists(json_path)):
116120
with open(json_path, 'r') as r:

ydb/tests/olap/lib/ydb_cluster.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ def get_cluster_info(cls):
5252
version = ''
5353
cluster_name = ''
5454
nodes_wilcard = ''
55+
max_start_time = 0
5556
nodes, node_count = cls._get_cluster_nodes()
5657
for node in nodes:
5758
n = node.get('SystemState', {})
59+
max_start_time = max(max_start_time, int(n.get('StartTime', 0)))
5860
cluster_name = n.get('ClusterName', cluster_name)
5961
version = n.get('Version', version)
6062
for tenant in n.get('Tenants', []):
@@ -67,6 +69,7 @@ def get_cluster_info(cls):
6769
'name': cluster_name,
6870
'nodes_wilcard': nodes_wilcard,
6971
'service_url': cls._get_service_url(),
72+
'max_start_time': max_start_time,
7073
}
7174
return deepcopy(cls._cluster_info)
7275

0 commit comments

Comments
 (0)