[Tarantool-patches] [PATCH 7/9] luatest: copy config in cluster:build_server()
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Sat Nov 6 02:56:38 MSK 2021
It takes box.cfg config as an argument. And changes the argument
by adding a new key 'command'. If the caller wants to pass the
same box.cfg or slightly modified to several build_server() calls,
it won't work - all options will be the same on all instances.
For example:
local cfg = {...}
cfg.replication = {url1}
cluster:build_server(cfg)
cfg.replication = {url2}
cluster:build_server(cfg)
It will not work. Both servers will get the same 'command' and the
same 'replication'.
---
test/luatest_helpers/cluster.lua | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/luatest_helpers/cluster.lua b/test/luatest_helpers/cluster.lua
index 01291b43c..43e3479f7 100644
--- a/test/luatest_helpers/cluster.lua
+++ b/test/luatest_helpers/cluster.lua
@@ -93,6 +93,7 @@ end
function Cluster:build_server(server_config, instance_file)
instance_file = instance_file or 'default.lua'
+ server_config = table.deepcopy(server_config)
server_config.command = fio.pathjoin(root, 'test/instances/', instance_file)
assert(server_config.alias, 'Either replicaset.alias or server.alias must be given')
local server = Server:new(server_config)
--
2.24.3 (Apple Git-128)
More information about the Tarantool-patches
mailing list