From c472e3af64aa0cd10cf96bce6a1f4647a07e8935 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 23 Jan 2015 17:47:45 -0300 Subject: [PATCH 1/3] deps: Update lua client The latest version works around a libuv bug that can leave zombie nvim processes despite the event loop being properly cleaned up. This can lead to functional tests being aborted depending on the maximum number of child processes configured for a platform. --- third-party/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 7c5906931d..302f7ab1f5 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -276,7 +276,7 @@ if(USE_BUNDLED_LUAROCKS) add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client COMMAND ${DEPS_BIN_DIR}/luarocks - ARGS build https://raw.githubusercontent.com/neovim/lua-client/a6c232da23dafe085c5606a3d0a666a77dd7d8bd/nvim-client-0.0.1-7.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR} + ARGS build https://raw.githubusercontent.com/neovim/lua-client/af161f5f89c7877d0f650b5de6b3a6126b38f012/nvim-client-0.0.1-10.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR} DEPENDS lpeg libuv) add_custom_target(nvim-client DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client) From 41225fe4f69b507b020d7bf4033e02d3f4fbdd40 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 23 Jan 2015 18:06:52 -0300 Subject: [PATCH 2/3] test: Fix hanging test suite after failures When a test that fails leaves nvim in a 'Press Enter...' state, the whole suite will hang because the `qa!` command executed before the next test won't be processed until '' is sent. Now the lua client can send a signal with when `Session:exit()` is called, so the `qa!` request is no longer necessary. Also: - Set noswapfile at startup to prevent tests from leaving .s* swap files(should also improve test environment determinism) - Use `assert(false, msg) instead of `error(msg)` to report screen assertion failures. --- test/functional/helpers.lua | 6 +++--- test/functional/ui/screen.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index c76979e894..ea98ff4ce3 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -6,7 +6,8 @@ local Session = require('nvim.session') local nvim_prog = os.getenv('NVIM_PROG') or 'build/bin/nvim' local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', - '--cmd', 'set shortmess+=I background=light', '--embed'} + '--cmd', 'set shortmess+=I background=light noswapfile', + '--embed'} local prepend_argv if os.getenv('VALGRIND') then @@ -153,8 +154,7 @@ end local function clear() if session then - session:request('vim_command', 'qa!') - session:exit() + session:exit(0) end local loop = Loop.new() local msgpack_stream = MsgpackStream.new(loop) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 29bbe69d8b..3070412e4d 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -192,7 +192,7 @@ function Screen:wait(check, timeout) err = check() end if err then - error(err) + assert(false, err) end end From cbc23d93b9f8dd8043836fa2d0ca36667a19a849 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 23 Jan 2015 19:00:45 -0300 Subject: [PATCH 3/3] test: Make default screen timeout depend on the VALGRIND env var While running under valgrind, the screen can take significantly longer to update(especially on travis) so a higher timeout can be required. Also reduce the timeout when not running on valgrind. --- test/functional/ui/screen.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 3070412e4d..ef99c2a536 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -85,6 +85,10 @@ Screen.__index = Screen local debug_screen +local default_screen_timeout = 2500 +if os.getenv('VALGRIND') then + default_screen_timeout = 7500 +end function Screen.debug(command) if not command then @@ -187,7 +191,7 @@ function Screen:wait(check, timeout) end return true end - run(nil, notification_cb, nil, timeout or 5000) + run(nil, notification_cb, nil, timeout or default_screen_timeout) if not checked then err = check() end