Skip to content

Commit 48e742f

Browse files
authored
switch off balance check in perf tests (#11560)
1 parent dddbb74 commit 48e742f

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

ydb/tests/olap/lib/ydb_cluster.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -235,27 +235,28 @@ def _check_node(n):
235235
elif isinstance(balanced_paths, list):
236236
for path in balanced_paths:
237237
paths_to_balance += cls._get_tables(path)
238-
for p in paths_to_balance:
239-
table_nodes, _ = cls.get_cluster_nodes(p)
240-
min = None
241-
max = None
242-
for tn in table_nodes:
243-
tablet_count = 0
244-
for tablet in tn.get("Tablets", []):
245-
if tablet.get("State") != "Green":
246-
errors.append(f'Node {tn.get("SystemState", {}).get("Host")}: {tablet.get("Count")} tablets of type {tablet.get("Type")} in {tablet.get("State")} state')
247-
if tablet.get("Type") in {"ColumnShard", "DataShard"}:
248-
tablet_count += tablet.get("Count")
249-
if tablet_count > 0:
250-
if min is None or tablet_count < min:
251-
min = tablet_count
252-
if max is None or tablet_count > max:
253-
max = tablet_count
254-
if min is None or max is None:
255-
errors.append(f'Table {p} has no tablets')
256-
elif max - min > 1:
257-
errors.append(f'Table {p} is not balanced: {min}-{max} shards.')
258-
LOGGER.info(f'Table {p} is balanced: {min}-{max} shards.')
238+
if os.getenv('TEST_CHECK_BALANCING', 'no') == 'yes':
239+
for p in paths_to_balance:
240+
table_nodes, _ = cls.get_cluster_nodes(p)
241+
min = None
242+
max = None
243+
for tn in table_nodes:
244+
tablet_count = 0
245+
for tablet in tn.get("Tablets", []):
246+
if tablet.get("State") != "Green":
247+
errors.append(f'Node {tn.get("SystemState", {}).get("Host")}: {tablet.get("Count")} tablets of type {tablet.get("Type")} in {tablet.get("State")} state')
248+
if tablet.get("Type") in {"ColumnShard", "DataShard"}:
249+
tablet_count += tablet.get("Count")
250+
if tablet_count > 0:
251+
if min is None or tablet_count < min:
252+
min = tablet_count
253+
if max is None or tablet_count > max:
254+
max = tablet_count
255+
if min is None or max is None:
256+
errors.append(f'Table {p} has no tablets')
257+
elif max - min > 1:
258+
errors.append(f'Table {p} is not balanced: {min}-{max} shards.')
259+
LOGGER.info(f'Table {p} is balanced: {min}-{max} shards.')
259260

260261
cls.execute_single_result_query("select 1", timeout)
261262
except BaseException as ex:

0 commit comments

Comments
 (0)