From 97a801e190e94ae804acc5075ba1f7bfaf7553cc Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy <nshirokovskiy@tarantool.org> Date: Wed, 8 May 2024 10:54:27 +0300 Subject: [PATCH] test: bump test-run to new version Bump test-run to new version with the following improvements: - Bump luatest to 1.0.1-14-gdfee2f3 [1] - Adjust test result report width to terminal size [2] - dispatcher: lift pipe buffer size restriction [3] - flake8: fix E721 do not compare types [4] [1] tarantool/test-run@84ebae5 [2] tarantool/test-run@1724211 [3] tarantool/test-run@81259c4 [4] tarantool/test-run@1037299 We also have to fix several tests that check that script with luatest assertions have empty stderr output. test-run brings Luatest which logs assertions at 'info' level. Note that gh_8433_raft_is_candidate_test is different. Original assertion involves logging huge tables that have somewhere closed sockets inside. And 'socket.__tostring' currently raises error for closed sockets. We need to fix gh_6819_iproto_watch_not_implemented_test also to account error created on loading `luatest` on `server:exec` after the commit "Add trace check for error assertions". Part of #9914 NO_DOC=internal NO_TEST=internal NO_CHANGELOG=internal --- test-run | 2 +- test/box-luatest/box_cfg_env_test.lua | 6 +----- test/box-luatest/box_schema_before_box_cfg_test.lua | 3 +-- test/box-luatest/error_subsystem_improvements_test.lua | 7 +++++++ .../gh_6819_iproto_watch_not_implemented_test.lua | 2 +- test/config-luatest/config_test.lua | 6 +----- test/config-luatest/helpers.lua | 6 +----- .../replication-luatest/gh_8433_raft_is_candidate_test.lua | 3 ++- 8 files changed, 15 insertions(+), 20 deletions(-) diff --git a/test-run b/test-run index ed5b623b08..84ebae5d04 160000 --- a/test-run +++ b/test-run @@ -1 +1 @@ -Subproject commit ed5b623b08509256d50b98e106c9ea016a52b4cb +Subproject commit 84ebae5d041125ab3bb52514c1472db844c45f20 diff --git a/test/box-luatest/box_cfg_env_test.lua b/test/box-luatest/box_cfg_env_test.lua index 57f7af9375..88eab17390 100644 --- a/test/box-luatest/box_cfg_env_test.lua +++ b/test/box-luatest/box_cfg_env_test.lua @@ -166,11 +166,7 @@ g.test_uri_list = function(g) local opts = {nojson = true, stderr = true} local res = justrun.tarantool(dir, {}, {'main.lua'}, opts) - t.assert_equals(res, { - exit_code = 0, - stdout = '', - stderr = '', - }) + t.assert_equals(res.exit_code, 0, {res.stdout, res.stderr}) end -- These test cases use a real box.cfg() call inside a child diff --git a/test/box-luatest/box_schema_before_box_cfg_test.lua b/test/box-luatest/box_schema_before_box_cfg_test.lua index 21e72d498b..39ca961dd1 100644 --- a/test/box-luatest/box_schema_before_box_cfg_test.lua +++ b/test/box-luatest/box_schema_before_box_cfg_test.lua @@ -67,6 +67,5 @@ g.test_box_schema_before_box_cfg = function() local opts = {nojson = true, stderr = true} local res = justrun.tarantool(dir, {}, {'main.lua'}, opts) - t.assert_equals(res.stderr, "") - t.assert_equals(res.exit_code, 0) + t.assert_equals(res.exit_code, 0, {res.stdout, res.stderr}) end diff --git a/test/box-luatest/error_subsystem_improvements_test.lua b/test/box-luatest/error_subsystem_improvements_test.lua index 413b4e741a..a81c25d4fb 100644 --- a/test/box-luatest/error_subsystem_improvements_test.lua +++ b/test/box-luatest/error_subsystem_improvements_test.lua @@ -1084,3 +1084,10 @@ g.after_test('test_netbox_call_trace', function(cg) end end) end) + +g.test_trace_checked = function() + local st, res = pcall(t.assert_error, + tarantool._internal.raise_incorrect_trace) + t.assert(not st) + t.assert_str_contains(res.message, 'Unexpected error trace'); +end diff --git a/test/box-luatest/gh_6819_iproto_watch_not_implemented_test.lua b/test/box-luatest/gh_6819_iproto_watch_not_implemented_test.lua index c37ee2cb76..7b1b6ceda4 100644 --- a/test/box-luatest/gh_6819_iproto_watch_not_implemented_test.lua +++ b/test/box-luatest/gh_6819_iproto_watch_not_implemented_test.lua @@ -71,7 +71,7 @@ g.test_iproto_watch_reported_but_not_implemented = function() g.server:exec(function(err_count_1) t.helpers.retrying({}, function() local err_count_2 = box.stat.ERROR.total - t.assert_equals(err_count_2 - err_count_1, 3) + t.assert_equals(err_count_2 - err_count_1, 4) end) end, {err_count_1}) conn:close() diff --git a/test/config-luatest/config_test.lua b/test/config-luatest/config_test.lua index 901378e943..d831f15318 100644 --- a/test/config-luatest/config_test.lua +++ b/test/config-luatest/config_test.lua @@ -165,11 +165,7 @@ g.test_configdata = function() local opts = {nojson = true, stderr = true} local res = justrun.tarantool(dir, {}, {'main.lua'}, opts) - t.assert_equals(res, { - exit_code = 0, - stdout = '', - stderr = '', - }) + t.assert_equals(res.exit_code, 0, {res.stdout, res.stderr}) end g.test_config_general = function() diff --git a/test/config-luatest/helpers.lua b/test/config-luatest/helpers.lua index cd3ce0888f..e3cfed91fa 100644 --- a/test/config-luatest/helpers.lua +++ b/test/config-luatest/helpers.lua @@ -64,11 +64,7 @@ local function run_as_script(f) local opts = {nojson = true, stderr = true} local res = justrun.tarantool(dir, {}, {'main.lua'}, opts) - t.assert_equals(res, { - exit_code = 0, - stdout = '', - stderr = '', - }) + t.assert_equals(res.exit_code, 0, {res.stdout, res.stderr}) end end diff --git a/test/replication-luatest/gh_8433_raft_is_candidate_test.lua b/test/replication-luatest/gh_8433_raft_is_candidate_test.lua index 340d2f7caa..791b6bf719 100644 --- a/test/replication-luatest/gh_8433_raft_is_candidate_test.lua +++ b/test/replication-luatest/gh_8433_raft_is_candidate_test.lua @@ -75,7 +75,8 @@ g.test_prevote_fail = function(g) -- the corresponding bit in leader_witness_map is cleared. -- 3. Break last applier and make sure, that election isn't started. -- - luatest.assert_equals(g.replica_set:get_leader(), g.server1) + luatest.assert_equals(g.replica_set:get_leader():get_instance_id(), + g.server1:get_instance_id()) local old_term = g.server1:get_election_term() g.server3:exec(function() box.cfg({election_mode = 'candidate'}) -- GitLab