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

Use poke_eventloop() to wait for Nvim to finish processing input.
This commit is contained in:
zeertzjq 2024-09-26 18:34:35 +08:00 committed by GitHub
parent 8070988247
commit 66197dde70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)