commit ba249cc8f592e9e64a2e6eee6fdf19e7cb89f7db from: Oleg Chaplashkin via: Yaroslav Lobankov date: Thu Oct 12 08:42:50 2023 UTC test: update gh_8083, gh_8445 and gh_7434 tests These tests fail after the commit [1] has been added to the Luatest: - app-luatest/gh_8083_fatal_signal_handler_test.lua - app-luatest/gh_8445_crash_during_crash_report_test.lua - box-luatest/gh_7434_yield_in_on_shutdown_trigger_test.lua The issue is due to lack of necessary directories: sh: 1: cd: can't cd to /tmp/t/001_app-luatest/server-XXX Just update tests on the simple `fio` module instead `luatest.server`. [1] tarantool/luatest@7d1358c NO_CHANGELOG=internal NO_DOC=internal (cherry picked from commit 23b61351dce4b930dad795d064cc1053a6624091) commit - 7b7d44f7459bc3df92143f6c4cac0bb415557a79 commit + ba249cc8f592e9e64a2e6eee6fdf19e7cb89f7db blob - c77d78d7ba2036d8143a78ae6194e8968952fc64 blob + bee19624f75fba5f5ea998fda73c940a4beef6fd --- test/app-luatest/gh_8083_fatal_signal_handler_test.lua +++ test/app-luatest/gh_8083_fatal_signal_handler_test.lua @@ -1,15 +1,15 @@ +local fio = require('fio') local t = require('luatest') local g = t.group('gh-8083', {{errinj = 'ERRINJ_SIGILL_MAIN_THREAD'}, {errinj = 'ERRINJ_SIGILL_NONMAIN_THREAD'}}) g.before_each(function(cg) - local server = require('luatest.server') - cg.server = server:new({alias = 'master'}) + cg.tempdir = fio.tempdir() end) g.after_each(function(cg) - cg.server:drop() + fio.rmtree(cg.tempdir) end) -- Check that forked Tarantool creates a crash report on the illegal instruction @@ -24,7 +24,7 @@ g.test_fatal_signal_handler = function(cg) -- Use `cd' and `shell = true' due to lack of cwd option in popen (gh-5633), -- `feedback_enabled = false' to avoid forking for sending feedback. local fmt = 'cd %s && %s -e "box.cfg{feedback_enabled = false} os.exit()"' - local cmd = string.format(fmt, cg.server.workdir, tarantool_exe) + local cmd = string.format(fmt, cg.tempdir, tarantool_exe) local ph = popen.new({cmd}, {stderr = popen.opts.PIPE, env = tarantool_env, shell = true}) t.assert(ph) blob - d2af12d04e4672cde97b8bfb0497d414306e44d9 blob + 4b76ce5bfbcb12d47fd4874ba390e587824cde26 --- test/app-luatest/gh_8445_crash_during_crash_report_test.lua +++ test/app-luatest/gh_8445_crash_during_crash_report_test.lua @@ -1,13 +1,13 @@ +local fio = require('fio') local t = require('luatest') local g = t.group('gh-8445') -g.before_all(function(cg) - local server = require('luatest.server') - cg.server = server:new({alias = 'gh-8445'}) +g.before_each(function(cg) + cg.tempdir = fio.tempdir() end) -g.after_all(function(cg) - cg.server:drop() +g.after_each(function(cg) + fio.rmtree(cg.tempdir) end) -- Check that forked Tarantool doesn't crash when preparing a crash report. @@ -17,7 +17,7 @@ g.test_crash_during_crash_report = function(cg) -- Use `cd' and `shell = true' due to lack of cwd option in popen (gh-5633). local exe = arg[-1] - local dir = cg.server.workdir + local dir = cg.tempdir local cmd = [[ cd %s && %s -e "box.cfg{} require('log').info('pid = ' .. box.info.pid)" ]] blob - 345fc57b855a3630e225d0ac607dadac874e2bd0 blob + aac59814f05e074c02d06b9f4cda5651bcdb7088 --- test/box-luatest/gh_7434_yield_in_on_shutdown_trigger_test.lua +++ test/box-luatest/gh_7434_yield_in_on_shutdown_trigger_test.lua @@ -10,15 +10,18 @@ local script = os.getenv('SOURCEDIR') .. '/test/box-lu local output_file g.before_all(function(cg) - local server = require('luatest.server') - cg.server = server:new({alias = 'master'}) - output_file = cg.server.workdir .. '/on_shutdown_completed.txt' + cg.tempdir = fio.tempdir() + output_file = cg.tempdir .. '/on_shutdown_completed.txt' end) g.after_each(function() os.remove(output_file) end) +g.after_all(function(cg) + fio.rmtree(cg.tempdir) +end) + -- Shutdown by reaching the end of the script g.test_finish = function() local ph = popen.new({tarantool, script, output_file})