diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-22 15:29:39 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-06-22 15:29:39 +0200 |
commit | bc10a15ea7a5e9108a0d60a2092b099b9a6a4805 (patch) | |
tree | 717bae423a01ab841ffb97250f2340b9d6d45417 /test/functional/api/proc_spec.lua | |
parent | f1f9a2f97b41d9d3aa21bbf4d577527b7700d82d (diff) | |
download | rneovim-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
Diffstat (limited to 'test/functional/api/proc_spec.lua')
-rw-r--r-- | test/functional/api/proc_spec.lua | 12 |
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) |