commit 0bd4d3f779e633feb4da1b43d87d713230ef0eec
parent bfb70c03ff2071cd26908dc7439647bf01cec2c0
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu, 8 Jan 2026 10:40:04 +0800
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.
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
@@ -437,9 +437,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 })