diff --git a/test/functional/autocmd/cursorhold_spec.lua b/test/functional/autocmd/cursorhold_spec.lua index 178ed69833..3c030d2911 100644 --- a/test/functional/autocmd/cursorhold_spec.lua +++ b/test/functional/autocmd/cursorhold_spec.lua @@ -75,8 +75,10 @@ describe('CursorHold', function() sleep(50) eq(0, api.nvim_get_var('cursorhold')) feed('0') - sleep(50) - eq(1, api.nvim_get_var('cursorhold')) + -- Poll: CursorHold may take longer than one 'updatetime' to fire. + retry(nil, 1000, function() + eq(1, api.nvim_get_var('cursorhold')) + end) end) end)