From 09edb145f5f3d10aadc9ba45358cdb1a0f166534 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Mon, 12 Jan 2026 22:26:59 +0200 Subject: [PATCH] test(pack): adjust `add` startup tests to just sleep with longer timeout Problem: The `add` startup tests mock startup process which requires *some* amount of time to be done. Previous solution with `vim.wait` to wait just enough time to register that startup script has finished doesn't seem to work as intended (it just wait full time). Its timeout is also seems to be barely enough to pass on Windows CI. Which will be a problem with more `git` actions done on startup in the future/next commit. Solution: Just sleep predetermined amount of time and explicitly check if startup script finished executing. --- test/functional/plugin/pack_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/functional/plugin/pack_spec.lua b/test/functional/plugin/pack_spec.lua index 9b4feb1b3b..8cf70f60d0 100644 --- a/test/functional/plugin/pack_spec.lua +++ b/test/functional/plugin/pack_spec.lua @@ -828,7 +828,8 @@ describe('vim.pack', function() local function assert_works() -- Should auto-install but wait before executing code after it n.clear({ args_rm = { '-u' } }) - n.exec_lua('vim.wait(500, function() return _G.done end, 50)') + vim.uv.sleep(2000) + eq(true, exec_lua('return _G.done')) assert_loaded() -- Should only `:packadd!`/`:packadd` already installed plugin