diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-09-26 18:34:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-26 18:34:35 +0800 |
commit | 66197dde7084484c9d23fa488b2288bcae364ba7 (patch) | |
tree | 499a7a3b36ad2ade3fe4512a74f3de620312643a | |
parent | 80709882476206b8f1ab3c004c82a1efd039c684 (diff) | |
download | rneovim-66197dde7084484c9d23fa488b2288bcae364ba7.tar.gz rneovim-66197dde7084484c9d23fa488b2288bcae364ba7.tar.bz2 rneovim-66197dde7084484c9d23fa488b2288bcae364ba7.zip |
test(api/buffer_updates_spec): prevent flakiness (#30521)
Use poke_eventloop() to wait for Nvim to finish processing input.
-rw-r--r-- | test/functional/api/buffer_updates_spec.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index e030b45396..527394bfd1 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -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) |