diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 3846cfd3ae..d081495dab 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -3297,7 +3297,11 @@ describe('API', function() -- On Windows, even though Nvim TUI handles SIGHUP, it's not possible for the -- parent process to know that, so exit code reflects SIGHUP. expected2.exitcode = (is_os('win') and 129 or 1) - eq(expected2, eval('nvim_get_chan_info(&channel)')) + local chaninfo2 = eval('nvim_get_chan_info(&channel)') + if t.is_asan() and chaninfo2.exitcode == 129 then + expected2.exitcode = 129 -- FIXME: SIGHUP sometimes isn't caught with ASAN. 96d6042689064 + end + eq(expected2, chaninfo2) -- :terminal with args + stopped process (shell-test). command('enew') diff --git a/test/functional/lua/system_spec.lua b/test/functional/lua/system_spec.lua index 372c5288be..20cec86fd3 100644 --- a/test/functional/lua/system_spec.lua +++ b/test/functional/lua/system_spec.lua @@ -4,7 +4,6 @@ local n = require('test.functional.testnvim')() local clear = n.clear local exec_lua = n.exec_lua local eq = t.eq -local pcall_err = t.pcall_err local function system_sync(cmd, opts) return exec_lua(function() @@ -18,8 +17,13 @@ local function system_sync(cmd, opts) local res = obj:wait() - -- Check the process is no longer running - assert(not vim.api.nvim_get_proc(obj.pid), 'process still exists') + -- Check the process is no longer running. nvim_get_proc() can lag the exit callback (on Windows)? + assert( + vim.wait(1000, function() + return not vim.api.nvim_get_proc(obj.pid) + end), + 'process still exists' + ) return res end) @@ -40,8 +44,13 @@ local function system_async(cmd, opts) assert(ok, 'process did not exit') - -- Check the process is no longer running - assert(not vim.api.nvim_get_proc(obj.pid), 'process still exists') + -- Check the process is no longer running. nvim_get_proc() can lag the exit callback (on Windows)? + assert( + vim.wait(1000, function() + return not vim.api.nvim_get_proc(obj.pid) + end), + 'process still exists' + ) return res end) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 63d600c1f8..34e7b12bc6 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -1199,7 +1199,9 @@ describe('TUI', function() it("split sequences work within 'ttimeoutlen' time", function() poke_both_eventloop() -- Make sure startup requests have finished. - child_session:request('nvim_set_option_value', 'ttimeoutlen', 250, {}) + -- The split sequences below are always completed, so this timeout never actually fires; it only + -- needs to exceed the inter-byte gap, which balloons on slow CI. + child_session:request('nvim_set_option_value', 'ttimeoutlen', n.load_adjust(1000), {}) feed_data('i') screen:expect([[ ^ | @@ -1236,7 +1238,11 @@ describe('TUI', function() {5:-- ^X mode (^]^D^E^F^I^K^L^N^O^P^Rs^U^V^Y)} | {5:-- TERMINAL --} | ]]) - -- is sent after 'ttimeoutlen' exceeds. + + -- is sent after 'ttimeoutlen' exceeds. Use a small value so the sleep below reliably exceeds it. + child_session:request('nvim_set_option_value', 'ttimeoutlen', 250, {}) + poke_both_eventloop() + feed_data('\027') screen:expect_unchanged(false, 25) vim.uv.sleep(225)