From 11fa4f42fd7cf02b9bf28dfe4e77fa3f4910c1c2 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 6 Feb 2015 15:11:04 -0300 Subject: [PATCH] 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. --- test/functional/shell/viml_system_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua index 25d2b5bc2c..d24646e712 100644 --- a/test/functional/shell/viml_system_spec.lua +++ b/test/functional/shell/viml_system_spec.lua @@ -248,7 +248,7 @@ describe('systemlist()', function() end) it('`yes` and is directly interrupted with CTRL-C', function() - feed(':call systemlist("echo")') + feed(':call systemlist("yes | xargs")') screen:expect([[ ^ | ~ | @@ -268,7 +268,7 @@ describe('systemlist()', function() end) it('`yes` and is a little bit later interrupted with CTRL-C', function() - feed(':call systemlist("echo")') + feed(':call systemlist("yes | xargs")') feed('') screen:expect([[ ^ |