test: unreliable "channel opened, ..., deleted by pressing a key"

Problem:
Test sometimes fails on macos:

    test/functional/terminal/channel_spec.lua:96: Expected objects to be the same.
    Passed in:
    (number) 3
    Expected:
    (number) 2

Solution:
Retry a few times.
This commit is contained in:
Justin M. Keyes
2025-12-02 00:14:09 -05:00
parent c8f2b10a40
commit ebd758f809

View File

@@ -92,7 +92,9 @@ describe('terminal channel is closed and later released if', function()
poke_eventloop()
feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after another main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
t.retry(20, nil, function()
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
end)
-- This indirectly covers #16264