mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch:8.2.0072: memory test still fails on Cirrus CI
Problem: Memory test still fails on Cirrus CI. Solution: Allow for a tiny bit more tolerance in the upper limit.bb062c1588
Check memory usage after Neovim sourced the Vimscript files. https://github.com/neovim/neovim/pull/12679 N/A patches for version.c: vim-patch:8.2.0062: memory test is flaky on FreeBSD Problem: Memory test is flaky on FreeBSD. Solution: Add a short sleep before getting the first size.e7538ae997
vim-patch:8.2.0071: memory test often fails on Cirrus CI Problem: Memory test often fails on Cirrus CI. Solution: Allow for more tolerance in the upper limit. Remove sleep.1832d12aea
This commit is contained in:
@@ -7,6 +7,9 @@ local iswin = helpers.iswin
|
|||||||
local retry = helpers.retry
|
local retry = helpers.retry
|
||||||
local ok = helpers.ok
|
local ok = helpers.ok
|
||||||
local source = helpers.source
|
local source = helpers.source
|
||||||
|
local wait = helpers.wait
|
||||||
|
local uname = helpers.uname
|
||||||
|
local load_adjust = helpers.load_adjust
|
||||||
|
|
||||||
local monitor_memory_usage = {
|
local monitor_memory_usage = {
|
||||||
memory_usage = function(self)
|
memory_usage = function(self)
|
||||||
@@ -99,6 +102,7 @@ describe('memory usage', function()
|
|||||||
call s:f(0)
|
call s:f(0)
|
||||||
endfor
|
endfor
|
||||||
]])
|
]])
|
||||||
|
wait()
|
||||||
local after = monitor_memory_usage(pid)
|
local after = monitor_memory_usage(pid)
|
||||||
-- Estimate the limit of max usage as 2x initial usage.
|
-- Estimate the limit of max usage as 2x initial usage.
|
||||||
-- The lower limit can fluctuate a bit, use 97%.
|
-- The lower limit can fluctuate a bit, use 97%.
|
||||||
@@ -143,16 +147,20 @@ describe('memory usage', function()
|
|||||||
call s:f()
|
call s:f()
|
||||||
endfor
|
endfor
|
||||||
]])
|
]])
|
||||||
|
wait()
|
||||||
local after = monitor_memory_usage(pid)
|
local after = monitor_memory_usage(pid)
|
||||||
for _ = 1, 3 do
|
for _ = 1, 3 do
|
||||||
feed_command('so '..fname)
|
feed_command('so '..fname)
|
||||||
|
wait()
|
||||||
end
|
end
|
||||||
local last = monitor_memory_usage(pid)
|
local last = monitor_memory_usage(pid)
|
||||||
-- The usage may be a bit less than the last value, use 80%.
|
-- 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
|
-- Allow for 20% tolerance at the upper limit. That's very permissive, but
|
||||||
-- otherwise the test fails sometimes.
|
-- otherwise the test fails sometimes. On Sourcehut CI with FreeBSD we need to
|
||||||
|
-- be even more permissive.
|
||||||
|
local upper_multiplier = uname() == 'freebsd' and 15 or 12
|
||||||
local lower = before.last * 8 / 10
|
local lower = before.last * 8 / 10
|
||||||
local upper = (after.max + (after.last - before.last)) * 12 / 10
|
local upper = load_adjust((after.max + (after.last - before.last)) * upper_multiplier / 10)
|
||||||
check_result({before=before, after=after, last=last},
|
check_result({before=before, after=after, last=last},
|
||||||
pcall(ok, lower < last.last))
|
pcall(ok, lower < last.last))
|
||||||
check_result({before=before, after=after, last=last},
|
check_result({before=before, after=after, last=last},
|
||||||
|
Reference in New Issue
Block a user