Skip to content
Snippets Groups Projects
Unverified Commit 56024743 authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Igor Munkin
Browse files

test: fix tarantool process teardown

Test uses a popen module that starts tarantool process in background
mode. Tarantool process started in background mode forks a new process
and closes a parent, after that popen loses a PID of the started process
and `ph:kill()` and `ph:terminate()` doesn't work anymore. It leads to
non-terminated tarantool processes after running the test.

Patch fixes that by running `kill` using os.execute with a PID of
tarantool process written to a pid file.

Follows up #6128

NO_CHANGELOG=fix test
NO_DOC=fix test

(cherry picked from commit 88686227)
parent 93812b3b
No related branches found
No related tags found
No related merge requests found
......@@ -50,12 +50,11 @@ pid_file='%s', background=true, work_dir='%s', log='%s',
t.helpers.retrying({timeout = 2, delay = 0.01}, function(path)
assert(fio.path.exists(path) == true)
end, g.log_path)
g.pid = fio.open(g.pid_path):read()
end)
g.after_test("test_background_mode_box_cfg", function(cg)
cg.ph:terminate()
cg.ph:wait()
cg.ph:close()
os.execute("kill -9 " .. cg.pid)
fio.unlink(cg.pid_path)
fio.unlink(cg.log_path)
os.remove("*.xlog")
......@@ -91,12 +90,11 @@ g.before_test("test_background_mode_env_vars", function()
t.helpers.retrying({timeout = 2, delay = 0.01}, function(path)
assert(fio.path.exists(path) == true)
end, g.log_path)
g.pid = fio.open(g.pid_path):read()
end)
g.after_test("test_background_mode_env_vars", function(cg)
cg.ph:terminate()
cg.ph:wait()
cg.ph:close()
os.execute("kill -9 " .. cg.pid)
fio.unlink(cg.pid_path)
fio.unlink(cg.log_path)
os.remove("*.xlog")
......
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