aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-06-22 15:29:39 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-06-22 15:29:39 +0200
commitbc10a15ea7a5e9108a0d60a2092b099b9a6a4805 (patch)
tree717bae423a01ab841ffb97250f2340b9d6d45417
parentf1f9a2f97b41d9d3aa21bbf4d577527b7700d82d (diff)
downloadrneovim-bc10a15ea7a5e9108a0d60a2092b099b9a6a4805.tar.gz
rneovim-bc10a15ea7a5e9108a0d60a2092b099b9a6a4805.tar.bz2
rneovim-bc10a15ea7a5e9108a0d60a2092b099b9a6a4805.zip
tests: fix "api nvim_get_proc_children returns child process ids" (#10296)
There might be an existing job already - maybe due to some other test, but in this case there was only one failure in the test run. ``` [----------] Running tests from C:/projects/neovim/test/functional\api\proc_spec.lua [ RUN ] api nvim_get_proc_children returns child process ids: ERR test\functional\helpers.lua:392: retry() attempts: 450 C:/projects/neovim/test/functional\api\proc_spec.lua:22: Expected objects to be the same. Passed in: (number) 2 Expected: (number) 1 stack traceback: test\functional\helpers.lua:392: in function 'retry' C:/projects/neovim/test/functional\api\proc_spec.lua:21: in function <C:/projects/neovim/test/functional\api\proc_spec.lua:17> ``` https://ci.appveyor.com/project/neovim/neovim/builds/25461215/job/8ns204v6091iy9rs?fullLog=true#L2672
-rw-r--r--test/functional/api/proc_spec.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/functional/api/proc_spec.lua b/test/functional/api/proc_spec.lua
index d99c26b6c2..e11e03203f 100644
--- a/test/functional/api/proc_spec.lua
+++ b/test/functional/api/proc_spec.lua
@@ -17,24 +17,28 @@ describe('api', function()
it('returns child process ids', function()
local this_pid = funcs.getpid()
+ -- Might be non-zero already (left-over from some other test?),
+ -- but this is not what is tested here.
+ local initial_childs = request('nvim_get_proc_children', this_pid)
+
local job1 = funcs.jobstart(nvim_argv)
retry(nil, nil, function()
- eq(1, #request('nvim_get_proc_children', this_pid))
+ eq(#initial_childs + 1, #request('nvim_get_proc_children', this_pid))
end)
local job2 = funcs.jobstart(nvim_argv)
retry(nil, nil, function()
- eq(2, #request('nvim_get_proc_children', this_pid))
+ eq(#initial_childs + 2, #request('nvim_get_proc_children', this_pid))
end)
funcs.jobstop(job1)
retry(nil, nil, function()
- eq(1, #request('nvim_get_proc_children', this_pid))
+ eq(#initial_childs + 1, #request('nvim_get_proc_children', this_pid))
end)
funcs.jobstop(job2)
retry(nil, nil, function()
- eq(0, #request('nvim_get_proc_children', this_pid))
+ eq(#initial_childs, #request('nvim_get_proc_children', this_pid))
end)
end)