let vim = s:vim_new()
call vim.start('--clean', '-c', 'set noswapfile', testfile)
- " Wait a bit until the process has started and sourced the script.
- sleep 200m
let before = s:monitor_memory_usage(vim.pid).last
call term_sendkeys(vim.buf, ":so %\<CR>")
" The usage may be a bit less than the last value, use 80%.
" Allow for 20% tolerance at the upper limit. That's very permissive, but
- " otherwise the test fails sometimes.
+ " otherwise the test fails sometimes. On Cirrus CI with FreeBSD we need to
+ " be even more permissive.
+ if has('bsd')
+ let multiplier = 14
+ else
+ let multiplier = 12
+ endif
let lower = before * 8 / 10
- let upper = (after.max + (after.last - before)) * 12 / 10
+ let upper = (after.max + (after.last - before)) * multiplier / 10
call assert_inrange(lower, upper, last)
call vim.stop()