Skip to content

Commit 502a29d

Browse files
authored
fix cluster life check (#9504)
1 parent f90b59c commit 502a29d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ydb/tests/olap/lib/allure_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from ydb.tests.olap.lib.ydb_cluster import YdbCluster
44
from ydb.tests.olap.lib.results_processor import ResultsProcessor
55
from urllib.parse import urlencode
6+
from datetime import datetime
67

78

89
def allure_test_description(
@@ -40,6 +41,7 @@ def _pretty_str(s):
4041
f"schema=/{test_info['database']}/{YdbCluster.tables_path}&tenantPage=query"
4142
f"&diagnosticsTab=nodes&name=/{test_info['database']}'>link</a>"
4243
),
44+
'timestamp': datetime.now().strftime('%c'),
4345
}
4446
)
4547
if ResultsProcessor.send_results:

ydb/tests/olap/lib/ydb_cluster.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ def _check_node(n):
170170
start_time = int(ss.get('StartTime', int(time()) * 1000)) / 1000
171171
uptime = int(time()) - start_time
172172
r = ss.get('Roles', [])
173-
role = r[0] if len(r) > 0 else role
173+
for role_candidate in ['Storage', 'Tenant']:
174+
if role_candidate in r:
175+
role = role_candidate
176+
break
174177
if uptime < 15:
175178
error = f'Node {name} too yong: {uptime}'
176179
except BaseException as ex:

0 commit comments

Comments
 (0)