Skip to content
Snippets Groups Projects
Unverified Commit 5e147360 authored by Oleg Chaplashkin's avatar Oleg Chaplashkin Committed by Yaroslav Lobankov
Browse files

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 23b61351)
parent d6f47f7d
No related branches found
No related tags found
No related merge requests found
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)
......
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)"
]]
......
......@@ -10,15 +10,18 @@ local script = os.getenv('SOURCEDIR') .. '/test/box-luatest/gh_7434_child.lua'
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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment