Skip to content

Commit 451cb2d

Browse files
committed
test: fix timeout error message for 2.10.0-rc1
Otherwise the test cases fail on tarantool 2.10.0-beta2-165-gc463e56b9 and newer. See tarantool/tarantool#6538.
1 parent e709a87 commit 451cb2d

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

test/helper.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,4 +488,25 @@ function helpers.count_on_replace_triggers(server, space_name)
488488
]], {space_name})
489489
end
490490

491+
-- 'Timeout exceeded' or 'timed out'.
492+
--
493+
-- See https://github.com/tarantool/tarantool/pull/6538.
494+
function helpers.assert_timeout_error(value, message)
495+
t.assert_type(value, 'string', nil, 2)
496+
497+
local err_1 = 'Timeout exceeded'
498+
local err_2 = 'timed out'
499+
500+
if string.find(value, err_1) or string.find(value, err_2) then
501+
return
502+
end
503+
504+
local err = string.format('Could not find %q or %q in string %q', err_1,
505+
err_2, value)
506+
if message ~= nil then
507+
err = message .. '\n' .. err
508+
end
509+
error(err, 2)
510+
end
511+
491512
return helpers

test/unit/call_test.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ g.test_timeout = function()
141141

142142
t.assert_equals(results, nil)
143143
t.assert_str_contains(err.err, "Failed for %w+%-0000%-0000%-0000%-000000000000", true)
144-
t.assert_str_contains(err.err, "Timeout exceeded")
144+
helpers.assert_timeout_error(err.err)
145145
end
146146

147147
local function check_single_vshard_call(g, exp_vshard_call, opts)
@@ -272,5 +272,5 @@ g.test_any_vshard_call_timeout = function()
272272

273273
t.assert_equals(results, nil)
274274
t.assert_str_contains(err.err, "Failed for %w+%-0000%-0000%-0000%-000000000000", true)
275-
t.assert_str_contains(err.err, "Timeout exceeded")
275+
helpers.assert_timeout_error(err.err)
276276
end

0 commit comments

Comments
 (0)