From 3d80ea0eb542f182ba5cddd7306734ee64006a24 Mon Sep 17 00:00:00 2001 From: Oleg Chaplashkin <ochaplashkin@tarantool.org> Date: Fri, 28 Jun 2024 16:28:25 +0400 Subject: [PATCH] test: adapt tests to the new luatest version With the new version of Luatest you have to be careful with the server log file. We used to get it very simply: box.cfg.log Now it is more correct to use the following approach: rawget(_G, 'box_cfg_log_file') or box.cfg.log Closes tarantool/test-run#439 NO_DOC=test NO_TEST=test NO_CHANGELOG=test (cherry picked from commit cfd4bf4685de6ee2dced133519ce34f71e3bb71b) --- .../gh_7904_export_box_schema_version_to_public_api_test.lua | 4 +++- .../gh_9797_netbox_on_disconnect_error_hangs_server_test.lua | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/box-luatest/gh_7904_export_box_schema_version_to_public_api_test.lua b/test/box-luatest/gh_7904_export_box_schema_version_to_public_api_test.lua index 18af7968f8..0413107646 100644 --- a/test/box-luatest/gh_7904_export_box_schema_version_to_public_api_test.lua +++ b/test/box-luatest/gh_7904_export_box_schema_version_to_public_api_test.lua @@ -23,7 +23,9 @@ g.test_box_internal_schema_version_deprecation = function(cg) local deprecation_warning = 'box.internal.schema_version will be removed, please use box.info.schema_version instead' t.assert_is_not(cg.server:grep_log(deprecation_warning, 256), nil) - local log_file = g.server:exec(function() return box.cfg.log end) + local log_file = g.server:exec(function() + return rawget(_G, 'box_cfg_log_file') or box.cfg.log + end) fio.truncate(log_file) cg.server:exec(function() box.internal.schema_version() diff --git a/test/box-luatest/gh_9797_netbox_on_disconnect_error_hangs_server_test.lua b/test/box-luatest/gh_9797_netbox_on_disconnect_error_hangs_server_test.lua index bff0cbc374..727c7dbbd1 100644 --- a/test/box-luatest/gh_9797_netbox_on_disconnect_error_hangs_server_test.lua +++ b/test/box-luatest/gh_9797_netbox_on_disconnect_error_hangs_server_test.lua @@ -24,7 +24,7 @@ g.test_on_disconnect_error_hangs_server = function(cg) local log_file = cg.server:exec(function() box.ctl.set_on_shutdown_timeout(1) -- `grep_log` will not be able to retrieve it after we drop the server. - return box.cfg.log + return rawget(_G, 'box_cfg_log_file') or box.cfg.log end) cg.server:drop() t.assert_not(cg.server:grep_log('on_shutdown triggers failed', 1024, -- GitLab