mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
tests: fix flaky "TermClose event triggers when fast-exiting terminal job stops" (#10377)
[ ERROR ]...neovim/neovim/test/functional/autocmd/termclose_spec.lua @ TermClose event triggers when fast-exiting terminal job stops test/functional/helpers.lua:96: Vim(call):E900: Invalid channel id stack traceback: test/functional/helpers.lua:96: in function 'request' test/functional/helpers.lua:254: in function 'command' ...neovim/neovim/test/functional/autocmd/termclose_spec.lua:23: in function <...neovim/neovim/test/functional/autocmd/termclose_spec.lua:20>
This commit is contained in:
parent
1c45ba462b
commit
5b94a2977a
@ -3,8 +3,8 @@ local helpers = require('test.functional.helpers')(after_each)
|
|||||||
|
|
||||||
local clear, command, nvim, nvim_dir =
|
local clear, command, nvim, nvim_dir =
|
||||||
helpers.clear, helpers.command, helpers.nvim, helpers.nvim_dir
|
helpers.clear, helpers.command, helpers.nvim, helpers.nvim_dir
|
||||||
local eval, eq, retry =
|
local eval, eq, neq, retry =
|
||||||
helpers.eval, helpers.eq, helpers.retry
|
helpers.eval, helpers.eq, helpers.neq, helpers.retry
|
||||||
local ok = helpers.ok
|
local ok = helpers.ok
|
||||||
local feed = helpers.feed
|
local feed = helpers.feed
|
||||||
local iswin = helpers.iswin
|
local iswin = helpers.iswin
|
||||||
@ -20,8 +20,9 @@ describe('TermClose event', function()
|
|||||||
it('triggers when fast-exiting terminal job stops', function()
|
it('triggers when fast-exiting terminal job stops', function()
|
||||||
command('autocmd TermClose * let g:test_termclose = 23')
|
command('autocmd TermClose * let g:test_termclose = 23')
|
||||||
command('terminal')
|
command('terminal')
|
||||||
command('call jobstop(b:terminal_job_id)')
|
-- shell-test exits immediately.
|
||||||
retry(nil, nil, function() eq(23, eval('g:test_termclose')) end)
|
retry(nil, nil, function() neq(-1, eval('jobwait([&channel], 0)[0]')) end)
|
||||||
|
eq(23, eval('g:test_termclose'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('triggers when long-running terminal job gets stopped', function()
|
it('triggers when long-running terminal job gets stopped', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user