Skip to content
Draft
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ add_custom_target(luatest
)

add_custom_target(luatest-no-coverage
COMMAND ${LUATEST} -v
COMMAND ${LUATEST} -v -c test/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Run regression tests without coverage"
)
Expand Down
6 changes: 2 additions & 4 deletions crud/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,9 @@ schema.init = function()
box.space[SETTINGS_SPACE]:create_index('primary', { parts = { 'key' }, if_not_exists = true })
end
else
while box.space[SETTINGS_SPACE] == nil or box.space[SETTINGS_SPACE].index[0] == nil do
if box.space[SETTINGS_SPACE] == nil or box.space[SETTINGS_SPACE].index[0] == nil then
fiber.sleep(0.05)
if not box.info.ro then
goto init_start
end
goto init_start
end
end

Expand Down
31 changes: 0 additions & 31 deletions test/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1217,39 +1217,8 @@ function helpers.backend_matrix(base_matrix, opts)
end

local backend_params = {
{
backend = helpers.backend.VSHARD,
backend_cfg = nil,
},
}

if helpers.is_cartridge_suite_supported() then
table.insert(backend_params,
{
backend = helpers.backend.CARTRIDGE,
backend_cfg = nil,
}
)
end

if helpers.is_name_supported_as_vshard_id() then
backend_params = helpers.extend_vshard_matrix(
backend_params,
'identification_mode',
{'uuid_as_key', 'name_as_key'},
{mode = 'replace'}
)
end

if helpers.is_master_discovery_supported_in_vshard() then
backend_params = helpers.extend_vshard_matrix(
backend_params,
'master',
{'auto'},
{mode = 'extend'}
)
end

if helpers.is_tarantool3_crud_roles_supported() then
table.insert(backend_params,
{
Expand Down
16 changes: 15 additions & 1 deletion test/tarantool3_helpers/cluster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,15 @@ end

function Cluster:wait_until_ready()
for _, server in ipairs(self.servers) do
server:wait_until_ready()
local ok, err = pcall(server.wait_until_ready, server)
if not ok then
--utils.dump_cluster_xlogs(self.servers)
print("################# ERR: " .. err)
if string.find(err, 'for "server is ready" condition for server') then
self.__do_dump_cluster = true
end
error(err)
end
end

for _, server in ipairs(self.servers) do
Expand Down Expand Up @@ -321,6 +329,12 @@ end

function Cluster:drop()
self:stop()

--print('################# DO DUMP CLUSTER XLOGS = ' .. tostring(self.__do_dump_cluster))
if self.__do_dump_cluster then
utils.dump_cluster_xlogs(self.servers)
end

treegen.clean(self.treegen)

return self
Expand Down
51 changes: 51 additions & 0 deletions test/tarantool3_helpers/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,54 @@ local function is_replicaset_a_crud_storage(group, replicaset)
return is_replicaset_has_role(group, replicaset, 'roles.crud-storage')
end

local utils = {}
function utils.dump_pretty(o, max_depth, __current_depth, __indent)
max_depth = max_depth or 8
__current_depth = __current_depth or 0
__indent = __indent or 0

if __current_depth > max_depth then
return '<MAX DEPTH>'
end

if type(o) == 'table' then
local s = '{\n'
__indent = __indent + 1
for k,v in pairs(o) do
if type(k) == 'table' then
k = '"<' .. tostring(k) .. '>"'
elseif type(k) ~= 'number' then
k = '"'..k..'"'
end
s = s .. string.rep(' ', 4*__indent) .. '['..k..'] = ' ..
utils.dump_pretty(v, max_depth, __current_depth + 1, __indent) .. ',\n'
end
__indent = __indent - 1
return s .. string.rep(' ', 4*__indent) .. '}'
else
return tostring(o)
end
end

local fio = require('fio')
local xlog = require('xlog')
local function dump_cluster_xlogs(servers)
print('###################### SNAP AND XLOG DUMP ######################')
for _, server in ipairs(servers) do
local xlogpath = fio.pathjoin(server.chdir, 'var', 'lib', server.alias)
if not fio.path.is_dir(xlogpath) then
error(xlogpath .. ' is not a directory')
end

print('###################### ' .. server.alias .. ' ######################')
for _, fname in ipairs(fio.listdir(xlogpath)) do
print('########## ' .. fname)
print(utils.dump_pretty(xlog.pairs(fio.pathjoin(xlogpath, fname)):totable()))
end
end
print('###################### END OF DUMP ######################')
end

return {
is_group_a_sharding_router = is_group_a_sharding_router,
is_group_a_sharding_storage = is_group_a_sharding_storage,
Expand All @@ -70,4 +118,7 @@ return {
is_group_a_crud_storage = is_group_a_crud_storage,
is_replicaset_a_crud_router = is_replicaset_a_crud_router,
is_replicaset_a_crud_storage = is_replicaset_a_crud_storage,

dump_pretty = utils.dump_pretty,
dump_cluster_xlogs = dump_cluster_xlogs,
}
Loading