Skip to content

Commit f68624f

Browse files
authored
check nodes after test and restart they before one (#16118)
1 parent 5ac9c8b commit f68624f

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

ydb/tests/functional/tpc/large/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ENV(YDB_ENABLE_COLUMN_TABLES="true")
1515
ENV(YDB_DRIVER_BINARY="ydb/apps/ydbd/ydbd")
1616
ENV(YDB_CLI_BINARY="ydb/apps/ydb/ydb")
1717
ENV(NO_KUBER_LOGS="yes")
18+
ENV(WAIT_CLUSTER_ALIVE_TIMEOUT="60")
1819

1920
PEERDIR(
2021
ydb/tests/functional/tpc/lib

ydb/tests/functional/tpc/lib/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ def setup_cluster(cls, table_service_config: dict = {}, memory_controller_config
4040
cls.cluster.register_and_start_slots(db, count=YdbCluster.get_dyn_nodes_count())
4141
cls.cluster.wait_tenant_up(db)
4242

43+
def setup_method(self, method):
44+
for node in self.cluster.nodes.values():
45+
node.start()
46+
for slot in self.cluster.slots.values():
47+
slot.start()
48+
self.cluster.wait_tenant_up(f'/{YdbCluster.ydb_database}')
49+
50+
def teardown_method(self, method):
51+
for node in self.cluster.nodes.values():
52+
if not node.is_alive():
53+
node.stop()
54+
for slot in self.cluster.slots.values():
55+
if not slot.is_alive():
56+
slot.stop()
57+
4358
@classmethod
4459
def run_cli(cls, argv: list[str]) -> yatest.common.process._Execution:
4560
return yatest.common.execute(YdbCliHelper.get_cli_command() + argv)

ydb/tests/functional/tpc/medium/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ENV(YDB_ENABLE_COLUMN_TABLES="true")
1414
ENV(YDB_DRIVER_BINARY="ydb/apps/ydbd/ydbd")
1515
ENV(YDB_CLI_BINARY="ydb/apps/ydb/ydb")
1616
ENV(NO_KUBER_LOGS="yes")
17+
ENV(WAIT_CLUSTER_ALIVE_TIMEOUT="60")
1718

1819
PEERDIR(
1920
ydb/tests/functional/tpc/lib

ydb/tests/olap/lib/ydb_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def _exec_cli(self) -> None:
278278

279279
def process(self) -> YdbCliHelper.WorkloadRunResult:
280280
try:
281-
wait_error = YdbCluster.wait_ydb_alive(20 * 60, self.db_path)
281+
wait_error = YdbCluster.wait_ydb_alive(int(os.getenv('WAIT_CLUSTER_ALIVE_TIMEOUT', 20 * 60)), self.db_path)
282282
if wait_error is not None:
283283
self.result.error_message = wait_error
284284
else:

ydb/tests/olap/load/lib/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def _attach_plans(plan: YdbCliHelper.QueryPlan, name: str) -> None:
249249
@classmethod
250250
def setup_class(cls) -> None:
251251
start_time = time()
252-
error = YdbCluster.wait_ydb_alive(20 * 60)
252+
error = YdbCluster.wait_ydb_alive(int(os.getenv('WAIT_CLUSTER_ALIVE_TIMEOUT', 20 * 60)))
253253
tb = None
254254
if not error and hasattr(cls, 'do_setup_class'):
255255
try:

0 commit comments

Comments
 (0)