commit a9454f85118781743139d2655b9260041687b680
parent 66b2e7da8a1fa6ba9587d89b94c0da185a4c6bc9
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun, 8 Feb 2026 08:49:13 +0800
test(api/server_requests_spec): fix flaky test (#37771)
Sometimes the scheduled :qall can arrive too late, so that EOF isn't
received in the same uv_run() call as the response.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua
@@ -401,7 +401,7 @@ describe('server -> client', function()
eq(
'RESPONSE',
n.exec_lua(function()
- local prepare = vim.uv.new_prepare()
+ local prepare = assert(vim.uv.new_prepare())
-- Block the event loop after writing the request but before polling for I/O
-- so that response and EOF arrive at the same uv_run() call.
prepare:start(function()
@@ -416,7 +416,9 @@ describe('server -> client', function()
)
end)
)
- eq({}, api.nvim_get_chan_info(id)) -- Channel is closed.
+ t.retry(nil, nil, function()
+ eq({}, api.nvim_get_chan_info(id)) -- Channel is closed.
+ end)
end)
it('via stdio, with many small flushes does not crash #23781', function()