mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: Remove nondeterminism in systemlist interrupt tests
The systemlist test currently calls the `echo` command which can potentially complete before being interrupted, causing random test failures. Use `yes | xargs` instead. A `yes` invocation that is not piped through `xargs` can produce a huge amount of lines in a very short time, leading memory starvation when the result is being converted into a list. `xargs` ensures only one line of output will be produced while allowing interrupt to be tested.
This commit is contained in:
parent
281cd3856c
commit
11fa4f42fd
@ -248,7 +248,7 @@ describe('systemlist()', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('`yes` and is directly interrupted with CTRL-C', function()
|
it('`yes` and is directly interrupted with CTRL-C', function()
|
||||||
feed(':call systemlist("echo")<cr><c-c>')
|
feed(':call systemlist("yes | xargs")<cr><c-c>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ |
|
^ |
|
||||||
~ |
|
~ |
|
||||||
@ -268,7 +268,7 @@ describe('systemlist()', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('`yes` and is a little bit later interrupted with CTRL-C', function()
|
it('`yes` and is a little bit later interrupted with CTRL-C', function()
|
||||||
feed(':call systemlist("echo")<cr>')
|
feed(':call systemlist("yes | xargs")<cr>')
|
||||||
feed('<c-c>')
|
feed('<c-c>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ |
|
^ |
|
||||||
|
Loading…
Reference in New Issue
Block a user