aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-12-04 22:18:11 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-12-05 01:46:40 +0100
commit7f386b175c2e0f7b76a6e21e38bbbff2f6083d0c (patch)
tree25518c1f23bc39914aed62efca0ba1969484834e
parent175174597dfb773ebe967adcae10a7eb568c32c2 (diff)
downloadrneovim-7f386b175c2e0f7b76a6e21e38bbbff2f6083d0c.tar.gz
rneovim-7f386b175c2e0f7b76a6e21e38bbbff2f6083d0c.tar.bz2
rneovim-7f386b175c2e0f7b76a6e21e38bbbff2f6083d0c.zip
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.
-rw-r--r--test/functional/helpers.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index da334d4ac6..1709427d59 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -261,6 +261,7 @@ local function retry(max, max_ms, fn)
if status then
return result
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 type(result) == "string" then
result = "\nretry() attempts: "..tostring(tries).."\n"..result