Skip to content

Commit 06f4e89

Browse files
authored
Different ydbds in harness (#9444)
1 parent e570d3a commit 06f4e89

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

ydb/tests/library/harness/kikimr_config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class KikimrConfigGenerator(object):
111111
def __init__(
112112
self,
113113
erasure=None,
114-
binary_path=None,
114+
binary_paths=None,
115115
nodes=None,
116116
additional_log_configs=None,
117117
port_allocator=None,
@@ -186,7 +186,7 @@ def __init__(
186186
self.__grpc_tls_key = key_pem
187187
self.__grpc_tls_cert = cert_pem
188188

189-
self.__binary_path = binary_path
189+
self.__binary_paths = binary_paths
190190
rings_count = 3 if erasure == Erasure.MIRROR_3_DC else 1
191191
if nodes is None:
192192
nodes = rings_count * erasure.min_fail_domains
@@ -526,11 +526,11 @@ def sqs_service_enabled(self):
526526
def output_path(self):
527527
return self.__output_path
528528

529-
@property
530-
def binary_path(self):
531-
if self.__binary_path is not None:
532-
return self.__binary_path
533-
return kikimr_driver_path()
529+
def get_binary_path(self, node_id):
530+
binary_paths = self.__binary_paths
531+
if not binary_paths:
532+
binary_paths = [kikimr_driver_path()]
533+
return binary_paths[node_id % len(binary_paths)]
534534

535535
def write_tls_data(self):
536536
if self.__grpc_ssl_enable:

ydb/tests/library/harness/kikimr_runner.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def __init__(self, node_id, config_path, port_allocator, cluster_name, configura
8787
}
8888

8989
daemon.Daemon.__init__(self, self.command, cwd=self.cwd, timeout=180, stderr_on_error_lines=240, **kwargs)
90-
self.__binary_path = None
9190

9291
@property
9392
def cwd(self):
@@ -107,9 +106,7 @@ def cwd(self):
107106

108107
@property
109108
def binary_path(self):
110-
if self.__binary_path:
111-
return self.__binary_path
112-
return self.__configurator.binary_path
109+
return self.__binary_path
113110

114111
@property
115112
def command(self):
@@ -272,7 +269,8 @@ def server(self):
272269

273270
def __call_kikimr_new_cli(self, cmd, connect_to_server=True):
274271
server = 'grpc://{server}:{port}'.format(server=self.server, port=self.nodes[1].port)
275-
full_command = [self.__configurator.binary_path]
272+
binary_path = self.__configurator.get_binary_path(0)
273+
full_command = [binary_path]
276274
if connect_to_server:
277275
full_command += ["--server={server}".format(server=server)]
278276
full_command += cmd
@@ -372,6 +370,7 @@ def __register_node(self):
372370
configurator=self.__configurator,
373371
udfs_dir=self.__common_udfs_dir,
374372
tenant_affiliation=self.__configurator.yq_tenant,
373+
binary_path=self.__configurator.get_binary_path(node_index),
375374
data_center=data_center,
376375
)
377376
return self._nodes[node_index]
@@ -402,6 +401,7 @@ def __register_slot(self, tenant_affiliation=None, encryption_key=None):
402401
node_broker_port=node_broker_port,
403402
tenant_affiliation=tenant_affiliation if tenant_affiliation is not None else 'dynamic',
404403
encryption_key=encryption_key,
404+
binary_path=self.__configurator.get_binary_path(slot_index),
405405
)
406406
return self._slots[slot_index]
407407

0 commit comments

Comments
 (0)