patch 8.2.4784: lamba test with timer is flaky
Problem: Lamba test with timer is flaky.
Solution: Adjust sleep time on retry.
diff --git a/src/testdir/test_lambda.vim b/src/testdir/test_lambda.vim
index 7726629..a5dce93 100644
--- a/src/testdir/test_lambda.vim
+++ b/src/testdir/test_lambda.vim
@@ -58,6 +58,7 @@
func Test_lambda_vim9cmd_linebreak()
CheckFeature timers
+ let g:test_is_flaky = 1
let lines =<< trim END
vim9cmd call timer_start(10, (x) => {
# comment
@@ -65,7 +66,8 @@
})
END
call v9.CheckScriptSuccess(lines)
- sleep 50m
+ " sleep longer on a retry
+ exe 'sleep ' .. [20, 100, 500, 500, 500][g:run_nr] .. 'm'
call assert_equal('done', g:result)
unlet g:result
endfunc