From 154f1c5abdf1dd84fb800aa8b46ec95224c36e77 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 8 Feb 2026 08:49:13 +0800 Subject: [PATCH] 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. (cherry picked from commit a9454f85118781743139d2655b9260041687b680) --- test/functional/api/server_requests_spec.lua | 6 ++++-- 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 index 4db1ce4d53..a920ad6ffb 100644 --- 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()