summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/vimscript/executable_spec.lua
diff options
context:
space:
mode:
authoratusy <30277794+atusy@users.noreply.github.com>2026-04-24 05:41:59 +0900
committerGitHub <noreply@github.com>2026-04-23 16:41:59 -0400
commit46b6859a4f0298b63b93fe07612a593b44d99ea6 (patch)
tree61b71b7aabfc48764ace3ddf8974e67d2aa5d02b /test/functional/vimscript/executable_spec.lua
parent0a8218a2b40fa8f6b533605db4377ff89250711c (diff)
fix(lsp): handle null id in JSON-RPC responses #38340
Problem: LSP spec allows response message to have a null request-id. This may happen when for example client sends unparseable request. https://github.com/microsoft/language-server-protocol/issues/196 Solution: Guard the server response branches against id=vim.NIL (json null), and handle error responses with null id by logging a warning and dispatching on error. Problem: CI (ubuntu asan, ubuntu tsan, windows) reports `uv_loop_close() hang?` from the two new null-id response tests. The leaked handle is the server-side accepted TCP socket created inside `server:listen` callback. The tests closed only the listener but not the accepted socket, so libuv could not finish shutting down the loop and each test session took ~2s extra to exit. Solution: Hoist the accepted socket to the outer `exec_lua` scope and close it at teardown before closing the listener. The close runs synchronously inside `exec_lua`, so the loop has time to dispose the handle before the session exits. * test(lsp): close accepted socket on read-loop exit/error Match the precedent in the handler test ("handler can return false as response") and the shared `_create_tcp_server` helper in `test/functional/plugin/lsp/testutil.lua`: close the accepted socket from inside the `create_read_loop` exit/error callbacks. The teardown close added in the previous commit remains as belt-and-suspenders, so the socket is disposed whether the server goes away first or the client does.
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions