From 9c5afe660667537f876d11c0486bedd7eb363e61 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 4 Aug 2026 14:00:13 -0400 Subject: [PATCH] =?UTF-8?q?test:=20unreliable=20"nvim.zip=20=E2=80=A6=20in?= =?UTF-8?q?correct=20password"=20#41159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: FAILED …/plugin/zip_spec.lua @ 442: nvim.zip reports an incorrect archive password Expected values to be equal. Expected: true Actual: false stack traceback: …/plugin/zip_spec.lua:453: in function <…/plugin/zip_spec.lua:442> Solution: The message is scheduled, so poll for it. --- test/functional/plugin/zip_spec.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/functional/plugin/zip_spec.lua b/test/functional/plugin/zip_spec.lua index 088f2441b6..a8592b2704 100644 --- a/test/functional/plugin/zip_spec.lua +++ b/test/functional/plugin/zip_spec.lua @@ -443,14 +443,18 @@ describe('nvim.zip', function() local archive = stage(fixtures, 'encrypted.zip') clear_zip() - -- Info-ZIP allows three attempts before giving up. - exec_lua(function(uri) + -- Info-ZIP allows three attempts before giving up. Failure msg is scheduled, so wait() for it. + local reported = exec_lua(function(uri) vim.api.nvim_input('no1no2no3') vim.api.nvim_cmd({ cmd = 'edit', args = { uri }, magic = { file = false, bar = false } }, {}) + return vim.wait(1000, function() + return vim.api + .nvim_exec2('messages', { output = true }).output + :find('incorrect password', 1, true) ~= nil + end) end, ('zip://%s/secret.txt'):format(archive)) - poke_eventloop() - eq(true, exec_capture('messages'):find('incorrect password', 1, true) ~= nil) + eq(true, reported) end) describe('extract', function()