Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion test/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,16 @@ function helpers.start_cluster(g, cartridge_cfg, vshard_cfg, tarantool3_cluster_
error(err)
end
end

if g.params and g.params.safe_mode ~= nil then
local safe_mod_func = '_crud.rebalance_safe_mode_disable'
if g.params.safe_mode then
safe_mod_func = '_crud.rebalance_safe_mode_enable'
end
helpers.call_on_storages(g.cluster, function(server)
server:call(safe_mod_func)
end)
end
end

local function count_storages_in_topology(g, backend, vshard_group, storage_roles)
Expand Down Expand Up @@ -1178,8 +1188,34 @@ function helpers.is_cartridge_suite_supported()
return is_module_provided and is_tarantool_supports
end

function helpers.backend_matrix(base_matrix)
function helpers.safe_mode_matrix(base_matrix)
base_matrix = base_matrix or {{}}

local safe_mode_params = {
{ safe_mode = true },
{ safe_mode = false },
}

local matrix = {}
for _, params in ipairs(safe_mode_params) do
for _, base in ipairs(base_matrix) do
base = table.deepcopy(base)
base.safe_mode = params.safe_mode
table.insert(matrix, base)
end
end

return matrix
end

function helpers.backend_matrix(base_matrix, opts)
base_matrix = base_matrix or {{}}
opts = opts or {}

if not opts.skip_safe_mode then
base_matrix = helpers.safe_mode_matrix(base_matrix)
end

local backend_params = {
{
backend = helpers.backend.VSHARD,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/not_initialized_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local server = require('luatest.server')

local pgroup = t.group('not-initialized', helpers.backend_matrix({
{},
}))
}, { skip_safe_mode = true }))

local vshard_cfg_template = {
sharding = {
Expand Down
1 change: 1 addition & 0 deletions test/unit/stats_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ local function enable_stats(g, params)
params = table.deepcopy(params)
params.backend = nil
params.backend_cfg = nil
params.safe_mode = nil
end
g.router:eval("stats_module.enable(...)", { params })
end
Expand Down
Loading