diff options
author | Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com> | 2021-06-13 02:53:05 +0530 |
---|---|---|
committer | Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com> | 2021-09-20 18:10:40 +0530 |
commit | 73d12a8b711743b1441f4029bee48cbaaf7791ec (patch) | |
tree | 07fd20364c86a36a37103cb5cb6e199150cffb5b /test/functional/api/server_requests_spec.lua | |
parent | 490e09c6d81b9bf52eac7aa146e62b3da2d86579 (diff) | |
download | rneovim-73d12a8b711743b1441f4029bee48cbaaf7791ec.tar.gz rneovim-73d12a8b711743b1441f4029bee48cbaaf7791ec.tar.bz2 rneovim-73d12a8b711743b1441f4029bee48cbaaf7791ec.zip |
test: fix running functional tests under gdbserver
It was not possible to run the tests under the gdbserver because we were
not closing the old session before starting a new one. This caused the
server to not to be able to bind to the given address and crashing the
tests.
This commit closes the session before starting a new one.
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
Diffstat (limited to 'test/functional/api/server_requests_spec.lua')
-rw-r--r-- | test/functional/api/server_requests_spec.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index e408890906..309d9084c8 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -278,8 +278,9 @@ describe('server -> client', function() local nvim_argv = merge_args(helpers.nvim_argv, {'--headless'}) local function connect_test(server, mode, address) local serverpid = funcs.getpid() - local client = spawn(nvim_argv) - set_session(client, true) + local client = spawn(nvim_argv, false, nil, true) + set_session(client) + local clientpid = funcs.getpid() neq(serverpid, clientpid) local id = funcs.sockconnect(mode, address, {rpc=true}) @@ -288,7 +289,7 @@ describe('server -> client', function() funcs.rpcrequest(id, 'nvim_set_current_line', 'hello') local client_id = funcs.rpcrequest(id, 'nvim_get_api_info')[1] - set_session(server, true) + set_session(server) eq(serverpid, funcs.getpid()) eq('hello', meths.get_current_line()) @@ -296,7 +297,7 @@ describe('server -> client', function() funcs.rpcrequest(client_id, 'nvim_set_current_line', 'howdy!') eq(id, funcs.rpcrequest(client_id, 'nvim_get_api_info')[1]) - set_session(client, true) + set_session(client) eq(clientpid, funcs.getpid()) eq('howdy!', meths.get_current_line()) |