mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: retry(): fix time calculation
libuv caches the results of uv.now() until the next loop tick. If a test does not spin the libuv event loop, retry() enters an infinite cycle.
This commit is contained in:
parent
175174597d
commit
7f386b175c
@ -261,6 +261,7 @@ local function retry(max, max_ms, fn)
|
|||||||
if status then
|
if status then
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
luv.update_time() -- Update cached value of luv.now() (libuv: uv_now()).
|
||||||
if (max and tries >= max) or (luv.now() - start_time > timeout) then
|
if (max and tries >= max) or (luv.now() - start_time > timeout) then
|
||||||
if type(result) == "string" then
|
if type(result) == "string" then
|
||||||
result = "\nretry() attempts: "..tostring(tries).."\n"..result
|
result = "\nretry() attempts: "..tostring(tries).."\n"..result
|
||||||
|
Loading…
Reference in New Issue
Block a user