From 4a997a1732fdb7a1c99cadf780b789f1ac84d990 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 26 Feb 2025 22:51:48 +0100 Subject: test: unreliable swapfile_preserve_recover_spec Problem: Test sometimes fails on bsd (cirrus ci): test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: retry() attempts: 464 test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:590: Expected objects to be the same. Passed in: (table: 0x0d5f1aa44070) { [1] = '' *[2] = '' [3] = '[Process exited 1]' } Expected: (table: 0x0d5ea3eb8718) { [1] = '' *[2] = '[Process exited 1]' [3] = '' } stack traceback: test/testutil.lua:104: in function 'retry' test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: in function Solution: Filter out empty items to avoid irrelevant redraw-timing assumptions. --- test/functional/ex_cmds/swapfile_preserve_recover_spec.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua index 38e6707a3b..8eec02524e 100644 --- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua +++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua @@ -152,6 +152,9 @@ describe('swapfile detection', function() it('redrawing during prompt does not break treesitter', function() local testfile = 'Xtest_swapredraw.lua' + finally(function() + os.remove(testfile) + end) write_file( testfile, [[ @@ -589,7 +592,9 @@ describe('quitting swapfile dialog on startup stops TUI properly', function() retry(nil, nil, function() eq( { '[Process exited 1]' }, - eval("[1, 2, '$']->map({_, lnum -> getline(lnum)->trim(' ', 2)})->filter({_, s -> !empty(trim(s))})") + eval( + "[1, 2, '$']->map({_, lnum -> getline(lnum)->trim(' ', 2)})->filter({_, s -> !empty(trim(s))})" + ) ) end) end) -- cgit