diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-04-09 02:11:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-09 02:11:08 +0200 |
commit | a34408ef7f5ce25462beedff44db552f11424f3f (patch) | |
tree | a236c403d5f37c4f72b632437493efaa0d609af8 /test/functional/helpers.lua | |
parent | cd0a436622d0eeafcbc79e0a6e53088b881ab5b1 (diff) | |
download | rneovim-a34408ef7f5ce25462beedff44db552f11424f3f.tar.gz rneovim-a34408ef7f5ce25462beedff44db552f11424f3f.tar.bz2 rneovim-a34408ef7f5ce25462beedff44db552f11424f3f.zip |
test: retry(): Report number of retries. (#6475)
tui_spec.lua: Retry the terminal-mode test.
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 335cf3c3ff..42ed1800d3 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -246,12 +246,13 @@ local function retry(max, max_ms, fn) return result end if (max and tries >= max) or (luv.now() - start_time > timeout) then - break + if type(result) == "string" then + result = "\nretry() attempts: "..tostring(tries).."\n"..result + end + error(result) end tries = tries + 1 end - -- Do not use pcall() for the final attempt, let the failure bubble up. - return fn() end local function clear(...) |