Skip to content

Commit ae4ee58

Browse files
committed
customize mon_port for local ydb
1 parent 50cf922 commit ae4ee58

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ydb/tests/olap/lib/ydb_cluster.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ def _create_ydb_driver(endpoint, database, oauth=None, iam_file=None):
154154
raise
155155

156156
@classmethod
157-
def reset(cls, ydb_endpoint, ydb_database):
157+
def reset(cls, ydb_endpoint, ydb_database, ydb_mon_port):
158158
cls.ydb_endpoint = ydb_endpoint
159159
cls.ydb_database = ydb_database
160+
cls.ydb_mon_port = ydb_mon_port
160161
cls._ydb_driver = None
161162

162163
@classmethod

ydb/tests/olap/scenario/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ def __init__(self, endpoint, database):
2929
if endpoint is not None:
3030
self._endpoint = endpoint
3131
self._database = database
32+
self._mon_port = 8765
3233
else:
3334
config = KikimrConfigGenerator()
3435
cluster = KiKiMR(configurator=config)
3536
cluster.start()
3637
node = cluster.nodes[1]
3738
self._endpoint = "grpc://%s:%d" % (node.host, node.port)
3839
self._database = config.domain_name
40+
self._mon_port = node.mon_port
3941
self._temp_ydb_cluster = cluster
4042
LOGGER.info(f'Using YDB, endpoint:{self._endpoint}, database:{self._database}')
4143

@@ -45,6 +47,9 @@ def endpoint(self):
4547
def database(self):
4648
return self._database
4749

50+
def mon_port(self):
51+
return self._mon_port
52+
4853
def stop(self):
4954
if self._temp_ydb_cluster is not None:
5055
self._temp_ydb_cluster.stop()
@@ -61,7 +66,7 @@ def setup_class(cls):
6166
ydb_endpoint = get_external_param('ydb-endpoint', None)
6267
ydb_database = get_external_param('ydb-db', "").lstrip('/')
6368
cls._ydb_instance = YdbClusterInstance(ydb_endpoint, ydb_database)
64-
YdbCluster.reset(cls._ydb_instance.endpoint(), cls._ydb_instance.database())
69+
YdbCluster.reset(cls._ydb_instance.endpoint(), cls._ydb_instance.database(), cls._ydb_instance.mon_port())
6570
if not external_param_is_true('reuse-tables'):
6671
ScenarioTestHelper(None).remove_path(cls.get_suite_name())
6772

0 commit comments

Comments
 (0)