test(lsp): fix flakiness in inline completion test (#35676)

The flakiness happens because get() uses vim.schedule(), and a following
key may be processed before the scheduled event. Use poke_eventloop() to
ensure that the scheduled event is processed.
This commit is contained in:
zeertzjq
2025-09-08 10:54:57 +08:00
committed by GitHub
parent f0bf6d7647
commit da78772328

View File

@@ -181,6 +181,7 @@ describe('vim.lsp.inline_completion', function()
exec_lua(function()
vim.lsp.inline_completion.get()
end)
n.poke_eventloop()
feed('<Esc>')
screen:expect({ grid = grid_applied_candidates })
end)
@@ -267,6 +268,7 @@ describe('vim.lsp.inline_completion', function()
exec_lua(function()
vim.lsp.inline_completion.get()
end)
n.poke_eventloop()
feed('<Esc>')
screen:expect([[
function fibonacci(n) { |