commit 06bce8bf5c3b6a2753778461426212c61e9f2036
parent fc0ee871de2f56dbb80879c912203a6372c54e1c
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 14 Aug 2023 06:47:09 +0800
test(terminal): fix scrollback test flakiness (#24708)
Problem: Terminal scrollback test is flaky.
Solution: Use INTERACT flag so the job doesn't exit immediately.
Diffstat:
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua
@@ -379,9 +379,7 @@ describe("'scrollback' option", function()
end)
local function set_fake_shell()
- -- shell-test.c is a fake shell that prints its arguments and exits.
- nvim('set_option_value', 'shell', testprg('shell-test'), {})
- nvim('set_option_value', 'shellcmdflag', 'EXE', {})
+ nvim('set_option_value', 'shell', string.format('"%s" INTERACT', testprg('shell-test')), {})
end
local function expect_lines(expected, epsilon)
@@ -514,9 +512,7 @@ describe("'scrollback' option", function()
-- _Global_ scrollback=-1 defaults :terminal to 10_000.
command('setglobal scrollback=-1')
- -- Pass a command to prevent the terminal buffer from automatically
- -- closing. The ':' command is just a no-op.
- command('terminal :')
+ command('terminal')
eq(10000, meths.get_option_value('scrollback', {}))
-- _Local_ scrollback=-1 in :terminal forces the _maximum_.