From ad70c2300ec4d9672cc2954265c41614aa2f4cff Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 8 Jan 2026 10:40:04 +0800 Subject: [PATCH] test(terminal/buffer_spec): fix flaky test (#37299) It turns out that uv_write() doesn't queue the write if there are no pending writes, so vim.uv.run() isn't needed to reproduce the crash. (cherry picked from commit 0bd4d3f779e633feb4da1b43d87d713230ef0eec) --- test/functional/terminal/buffer_spec.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 7bae7a2fdf..f24fa3ac11 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -443,9 +443,8 @@ describe(':terminal buffer', function() screen:expect_unchanged() --- @type string local title_before_del = exec_lua(function() - vim.wait(10) -- Ensure there are no pending events. + vim.wait(10) -- Ensure there are no pending events so that a write isn't queued. vim.api.nvim_chan_send(vim.bo.channel, '\027]2;OTHER_TITLE\007') - vim.uv.run('once') -- Only process the pending write. vim.uv.sleep(50) -- Block the event loop and wait for tty-test to forward OSC 2. local term_title = vim.b.term_title vim.api.nvim_buf_delete(0, { force = true })