test(api/buffer_updates_spec): prevent flakiness (#30521)

Use poke_eventloop() to wait for Nvim to finish processing input.

(cherry picked from commit 66197dde70)
This commit is contained in:
zeertzjq
2024-09-26 18:34:35 +08:00
committed by github-actions[bot]
parent e537379641
commit d535482ab2

View File

@ -27,12 +27,10 @@ end
local function sendkeys(keys)
api.nvim_input(keys)
-- give nvim some time to process msgpack requests before possibly sending
-- Wait for Nvim to fully process pending input before possibly sending
-- more key presses - otherwise they all pile up in the queue and get
-- processed at once
local ntime = os.clock() + 0.1
repeat
until os.clock() > ntime
n.poke_eventloop()
end
local function open(activate, lines)