From 1dc497398ed50a124565584b45eb6a610e56fa95 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 18 Apr 2018 09:42:56 +0200 Subject: test: nodejs_spec: allow more time for nodejs init --- test/functional/provider/nodejs_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/functional/provider/nodejs_spec.lua b/test/functional/provider/nodejs_spec.lua index 0a12b1a154..d9af020bfe 100644 --- a/test/functional/provider/nodejs_spec.lua +++ b/test/functional/provider/nodejs_spec.lua @@ -35,7 +35,7 @@ describe('nodejs host', function() nvim.command('call jobstop(g:job_id)'); ]]) command('let g:job_id = jobstart(["node", "'..fname..'"])') - retry(nil, 1000, function() eq('hello', eval('g:job_out')) end) + retry(nil, 2000, function() eq('hello', eval('g:job_out')) end) end) it('plugin works', function() local fname = 'Xtest-nodejs-hello-plugin.js' @@ -56,6 +56,6 @@ describe('nodejs host', function() nvim.command('call jobstop(g:job_id)'); ]]) command('let g:job_id = jobstart(["node", "'..fname..'"])') - retry(nil, 1000, function() eq('hello-plugin', eval('g:job_out')) end) + retry(nil, 2000, function() eq('hello-plugin', eval('g:job_out')) end) end) end) -- cgit From 522443d6bfa155a71968e886cc7869c2d370cc47 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 18 Apr 2018 09:47:51 +0200 Subject: test/util: retry(): also decorate non-string error --- test/functional/helpers.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 03c6f3bbaa..e690fe350d 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -306,10 +306,7 @@ local function retry(max, max_ms, fn) 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 - end - error(result) + error("\nretry() attempts: "..tostring(tries).."\n"..tostring(result)) end tries = tries + 1 end -- cgit