neovim/test/functional/vimscript
Justin M. Keyes 4fb48c5654
feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
PROBLEM
------------------------------------------------------------------------
$NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the
current process should listen on this address") and a descriptor ("the
current process is a child of this address").

This contradiction means the presence of NVIM_LISTEN_ADDRESS is
ambiguous, so child Nvim always tries to listen on its _parent's_
socket. This is the cause of lots of  "Failed to start server" spam in
our test/CI logs:

    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0
    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0

SOLUTION
------------------------------------------------------------------------

1. Set $NVIM to the parent v:servername, *only* in child processes.
   - Now the correct way to detect a "parent" Nvim is to check for $NVIM.
2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes.
3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after
   server init.
4. Open a channel to parent automatically, expose it as v:parent.

Fixes #3118
Fixes #6764
Fixes #9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696
2022-05-03 06:08:35 -07:00
..
api_functions_spec.lua
buf_functions_spec.lua
changedtick_spec.lua
container_functions_spec.lua
ctx_functions_spec.lua
environ_spec.lua
errorlist_spec.lua
eval_spec.lua vim-patch:8.2.3917: the eval.txt help file is way too big 2022-01-29 15:19:29 -05:00
executable_spec.lua fix(eval): checking for a non-empty string is too strict (#15987) 2021-10-28 22:13:40 -04:00
execute_spec.lua
exepath_spec.lua fix(eval): checking for a non-empty string is too strict (#15987) 2021-10-28 22:13:40 -04:00
fnamemodify_spec.lua
functions_spec.lua vim-patch:8.2.3917: the eval.txt help file is way too big 2022-01-29 15:19:29 -05:00
getline_spec.lua
glob_spec.lua
has_spec.lua fix: has() should preserve v:shell_error #18280 2022-04-26 20:58:25 -07:00
hostname_spec.lua
input_spec.lua
json_functions_spec.lua feat(eval/method): partially port v8.1.1954 2021-10-03 20:06:33 +01:00
lang_spec.lua feat(test): use nvim_exec in helpers.source() #16064 2022-03-27 10:25:55 -07:00
let_spec.lua
map_functions_spec.lua
match_functions_spec.lua
minmax_functions_spec.lua
modeline_spec.lua
msgpack_functions_spec.lua fix(ci): workaround bug in msgpackparse() on windows caused by api level bump 2022-04-25 16:30:20 +02:00
null_spec.lua fix(eval): checking for a non-empty string is too strict (#15987) 2021-10-28 22:13:40 -04:00
operators_spec.lua
printf_spec.lua
reltime_spec.lua test: correct order of arguments to eq() and neq() 2022-04-26 11:38:58 +08:00
screenpos_spec.lua fix(screenpos, float): add top and left border adjustment 2021-12-15 22:40:10 +08:00
server_spec.lua feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009 2022-05-03 06:08:35 -07:00
setpos_spec.lua test: correct order of arguments to eq() and neq() 2022-04-26 11:38:58 +08:00
sort_spec.lua
special_vars_spec.lua
string_spec.lua
system_spec.lua fix(input): only disable mapped CTRL-C interrupts when getting input (#18310) 2022-04-30 13:11:35 +08:00
timer_spec.lua fix(event-loop): duplicate display updating logic in vgetorpeek() (#17913) 2022-03-30 05:25:00 +08:00
uniq_spec.lua
vvar_event_spec.lua
wait_spec.lua
writefile_spec.lua