Skip to content

Commit da78772

Browse files
authored
test(lsp): fix flakiness in inline completion test (neovim#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.
1 parent f0bf6d7 commit da78772

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/plugin/lsp/inline_completion_spec.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ describe('vim.lsp.inline_completion', function()
181181
exec_lua(function()
182182
vim.lsp.inline_completion.get()
183183
end)
184+
n.poke_eventloop()
184185
feed('<Esc>')
185186
screen:expect({ grid = grid_applied_candidates })
186187
end)
@@ -267,6 +268,7 @@ describe('vim.lsp.inline_completion', function()
267268
exec_lua(function()
268269
vim.lsp.inline_completion.get()
269270
end)
271+
n.poke_eventloop()
270272
feed('<Esc>')
271273
screen:expect([[
272274
function fibonacci(n) { |

0 commit comments

Comments
 (0)