Skip to content

Commit 9f9b923

Browse files
authored
Check if tables has no tablets, send database param (#11538)
1 parent c9d166e commit 9f9b923

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ydb/tests/olap/lib/ydb_cluster.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def _get_service_url(cls):
5555
@classmethod
5656
def get_cluster_nodes(cls, path=None):
5757
try:
58-
url = f'{cls._get_service_url()}/viewer/json/nodes?'
58+
url = f'{cls._get_service_url()}/viewer/json/nodes?database={cls.ydb_database}'
5959
if path is not None:
60-
url += f'path={path}&tablets=true'
60+
url += f'&path={path}&tablets=true'
6161
headers = {}
6262
# token = os.getenv('OLAP_YDB_OAUTH', None)
6363
# if token is not None:
@@ -250,7 +250,9 @@ def _check_node(n):
250250
min = tablet_count
251251
if max is None or tablet_count > max:
252252
max = tablet_count
253-
if min is not None and max - min > 1:
253+
if min is None or max is None:
254+
errors.append(f'Table {p} has no tablets')
255+
elif max - min > 1:
254256
errors.append(f'Table {p} is not balanced: {min}-{max} shards.')
255257
LOGGER.info(f'Table {p} is balanced: {min}-{max} shards.')
256258

0 commit comments

Comments
 (0)