From 5e2ad295c07fa66c6e8ec05b1142b2964eabba9b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 18 Jul 2026 05:39:36 -0400 Subject: [PATCH] =?UTF-8?q?test:=20unreliable=20":terminal=20buffer=20?= =?UTF-8?q?=E2=80=A6=20partial=20mappings"=20#40806?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: FAILED …/terminal/buffer_spec.lua @ 348: :terminal buffer is refreshed with partial mappings in Normal mode …/terminal/buffer_spec.lua:348: Row 2 did not match. Expected: |tty ready | |*^jjjjjjjjjj | | | | | | | | | | | Actual: |tty ready | |*^jjjjjjjjj | | | | | | | | | | | Solution: Increase sleep time. --- test/functional/terminal/buffer_spec.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index e3fbbe9cac..bf1800effc 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -310,7 +310,10 @@ describe(':terminal buffer', function() screen:expect_unchanged() for i = 1, 10 do eq({ mode = 't', blocking = true }, api.nvim_get_mode()) - vim.uv.sleep(15) -- Wait for the previously scheduled refresh timer to arrive + -- Wait for the previously scheduled refresh timer to arrive. Must comfortably exceed + -- terminal.c REFRESH_DELAY *plus* PTY echo round-trip; else the refresh isn't queued before + -- the next key and, since a partial mapping never drains main_loop.events, screen is stale. + vim.uv.sleep(50) feed('j') -- Refresh scheduled for the last 'j' and processed for the one before screen:expect(([[ tty ready | @@ -343,7 +346,10 @@ describe(':terminal buffer', function() screen:expect_unchanged() for i = 1, 10 do eq({ mode = 'nt', blocking = true }, api.nvim_get_mode()) - vim.uv.sleep(15) -- Wait for the previously scheduled refresh timer to arrive + -- Wait for the previously scheduled refresh timer to arrive. Must comfortably exceed + -- terminal.c REFRESH_DELAY *plus* PTY echo round-trip; else the refresh isn't queued before + -- the next key and, since a partial mapping never drains main_loop.events, screen is stale. + vim.uv.sleep(50) feed('j') -- Refresh scheduled for the last 'j' and processed for the one before screen:expect(([[ tty ready |