Merge #42471 unreliable tests

This commit is contained in:
Justin M. Keyes authored and GitHub committed 2026-10-19 13:22:43 -04:00
commit 4c50814fca
3 files changed
+49 -19

No files matched your search

+4
View File
@@ -67,6 +67,10 @@ jobs:
TEST_TIMEOUT: 600
run: |
$ErrorActionPreference = 'Continue'
# Keep an MSYS process (Git's usr/bin) alive, so the MSYS runtime initializes its shared
# state only once. Else a test that kills an MSYS process during that init (CTRL-C) can
# make the next one stall 15s and die: "fatal error - add_item (...) failed, errno 1".
Start-Process -WindowStyle Hidden (Get-Command sleep.exe).Source infinity
# `-k 0` tells ninja to continue running all targets even if some fail.
cmake --build build --target functionaltest-parallel -j 2 -- -k 0
$exitCode = $LASTEXITCODE
+13 -4
View File
@@ -297,10 +297,19 @@ describe('TUI :detach', function()
end)
-- Simulate the host terminal disconnecting: SIGKILL the client so it can't shut down cleanly.
-- On Windows this also exercises the console hand-off in rpc_close_event().
n.exec_lua(function(pid)
--
-- On Windows this also exercises console hand-off in rpc_close_event(), which must finish
-- before the :terminal closes the console (client exit), else the server dies with it. So defer
-- this Nvim's job-exit handling (`vim.wait(fast_only=true)`) until the server drops the UI.
n.exec_lua(function(pid, addr)
vim.uv.kill(pid, 'sigkill')
end, n.fn.jobpid(term_job))
local chan = vim.fn.sockconnect('pipe', addr, { rpc = true })
assert(vim.wait(4000, function()
return #vim.rpcrequest(chan, 'nvim_list_uis') == 0
end, 10, true))
vim.fn.chanclose(chan)
end, n.fn.jobpid(term_job), child_server)
screen:expect({ any = vim.pesc('[Process exited') })
retry(nil, 4000, function()
eq(2, ({ n.connect(child_server):request('nvim_eval', '1+1') })[2])
@@ -5200,7 +5209,7 @@ describe('TUI client', function()
test_remote_tui_quit()
end)
it('with :cquit', function()
it('with :cquit', { retries = 2 }, function()
test_remote_tui_quit(42)
end)
end)
+32 -15
View File
@@ -47,6 +47,21 @@ void ui_refresh(void)
)
end
--- Waits for the async parse, and the fold update that follows it.
local function wait_folds()
exec_lua(function()
local done = false
-- Queued after the in-flight parse's callbacks (if any), so folds have updated when it runs.
vim.treesitter.get_parser(0):parse(nil, function()
done = true
end)
assert(vim.wait(5000, function()
return done
end))
end)
poke_eventloop()
end
local function get_fold_levels()
return exec_lua(function()
local res = {}
@@ -91,7 +106,7 @@ void ui_refresh(void)
parse('c')
command('1,2d')
poke_eventloop()
wait_folds()
eq({
[1] = '0',
@@ -114,7 +129,7 @@ void ui_refresh(void)
}, get_fold_levels())
command('1put!')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -157,7 +172,7 @@ t2]])
}, get_fold_levels())
feed('2ggo<Esc>')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -168,7 +183,7 @@ t2]])
}, get_fold_levels())
feed('dd')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -178,7 +193,7 @@ t2]])
}, get_fold_levels())
feed('2ggdd')
poke_eventloop()
wait_folds()
eq({
[1] = '0',
@@ -187,7 +202,7 @@ t2]])
}, get_fold_levels())
feed('u')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -197,7 +212,7 @@ t2]])
}, get_fold_levels())
feed('3ggdd')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -206,7 +221,7 @@ t2]])
}, get_fold_levels())
feed('u')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -217,7 +232,7 @@ t2]])
feed('3ggI#<Esc>')
parse()
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -228,7 +243,7 @@ t2]])
feed('x')
parse()
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -264,7 +279,7 @@ end
}, get_fold_levels())
command('1,4join')
poke_eventloop()
wait_folds()
eq({
[1] = '0',
@@ -272,7 +287,7 @@ end
}, get_fold_levels())
feed('u')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -317,7 +332,7 @@ end]])
command('1,8join')
feed('u')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -361,7 +376,7 @@ end]])
}, get_fold_levels())
command('2,6join')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -370,7 +385,7 @@ end]])
}, get_fold_levels())
feed('u')
poke_eventloop()
wait_folds()
eq({
[1] = '>1',
@@ -803,6 +818,7 @@ t2]])
[18] = '2',
[19] = '1',
}
wait_folds()
eq(foldlevels, get_fold_levels())
-- only changing filetype should change the parser again
@@ -810,6 +826,7 @@ t2]])
expect_no_folds()
command('set ft=c')
wait_folds()
eq(foldlevels, get_fold_levels())
end)