From 4d90288c694e0956214c1c54f3c1b2e19eee507a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 16 Jul 2026 17:25:28 -0400 Subject: [PATCH] test: unreliable "bumps 'busy' on each watched buffer" #40775 --- test/functional/options/autoread_spec.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/functional/options/autoread_spec.lua b/test/functional/options/autoread_spec.lua index be59da82ee..b03522bda3 100644 --- a/test/functional/options/autoread_spec.lua +++ b/test/functional/options/autoread_spec.lua @@ -189,11 +189,15 @@ describe('autoread file watcher', function() write_file(path1, 'b1\n') write_file(path2, 'b2\n') - -- Confirm busy=1 during the debounce window. - retry(nil, 1000, function() - eq(1, api.nvim_get_option_value('busy', { buf = buf1 })) - eq(1, api.nvim_get_option_value('busy', { buf = buf2 })) - end) + -- Confirm busy=1. Sample with vim.wait: busy=1 pulse only lasts ~debounce_ms. + eq( + true, + n.exec_lua(function(b1, b2) + return vim.wait(2000, function() + return vim.bo[b1].busy == 1 and vim.bo[b2].busy == 1 + end, 5) + end, buf1, buf2) + ) -- Confirm busy=0 after the autoread. retry(nil, 3000, function()