vim-patch:8.1.1027: memory usage test sometimes fails

Problem:    Memory usage test sometimes fails.
Solution:   Use 80% of before.last as the lower limit. (Christian Brabandt)
08cda65ddf
This commit is contained in:
erw7 2019-09-06 00:19:02 +09:00
parent 1212390254
commit 9ad2ba1c5c

View File

@ -143,8 +143,10 @@ describe('memory usage', function()
feed_command('so '..fname)
end
local last = monitor_memory_usage(pid)
-- The usage may be a bit less than the last value
local lower = before.last * 8 / 10
check_result({before=before, after=after, last=last},
pcall(ok, before.last < last.last))
pcall(ok, lower < last.last))
check_result({before=before, after=after, last=last},
pcall(ok, last.last < after.max + (after.last - before.last)))
end)