test: close timers in vim_spec.lua functional test

Close the timer started during tests before closing the session. This
fixes the uv_loop_close hangs happening in the functional tests.

Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
This commit is contained in:
Shreyansh Chouhan
2021-09-19 22:20:24 +05:30
parent 73d12a8b71
commit 12bccc7dd1

View File

@@ -2026,6 +2026,8 @@ describe('lua stdlib', function()
-- Would wait ten seconds if results blocked.
wait_result = vim.wait(10000, function() return vim.g.timer_result end)
timer:close()
return {
time = (start_time + 5) > get_time(),
wait_result = wait_result,
@@ -2045,6 +2047,8 @@ describe('lua stdlib', function()
wait_result = vim.wait(300, function() return vim.g.timer_result end, nil, true)
timer:close()
return {
wait_result = wait_result,
}