commit 85ddd0074b71d006746cb298e73e6ba2f5a52541
parent 28ef4a44925a1b1cbf291347aba43012ab038523
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun, 15 Oct 2023 06:38:43 +0800
test(terminal/channel_spec): fix flakiness (#25649)
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua
@@ -24,6 +24,7 @@ describe('terminal channel is closed and later released if', function()
-- channel hasn't been released yet
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[bdelete! | call chansend(id, 'test')]]))
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after one main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -40,6 +41,7 @@ describe('terminal channel is closed and later released if', function()
feed('i<CR>')
-- need to first process input
poke_eventloop()
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after another main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -55,6 +57,7 @@ describe('terminal channel is closed and later released if', function()
-- channel still hasn't been released yet
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[bdelete | call chansend(id, 'test')]]))
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after one main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -72,6 +75,7 @@ describe('terminal channel is closed and later released if', function()
feed('i<CR>')
-- need to first process input
poke_eventloop()
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after another main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -89,6 +93,7 @@ describe('terminal channel is closed and later released if', function()
-- channel still hasn't been released yet
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[bdelete | call chansend(id, 'test')]]))
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after one main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)