mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.1058: memory usage test may still fail on some systems
Problem: Memory usage test may still fail on some systems.
Solution: Use 98% of the lower limit. (Christian Brabandt)
3a731ee0c2
This commit is contained in:
parent
6b3399338f
commit
a32bac0c04
@ -101,11 +101,13 @@ describe('memory usage', function()
|
||||
]])
|
||||
local after = monitor_memory_usage(pid)
|
||||
-- Estimate the limit of max usage as 2x initial usage.
|
||||
check_result({before=before, after=after}, pcall(ok, before.last < after.max))
|
||||
check_result({before=before, after=after}, pcall(ok, before.last * 2 > after.max))
|
||||
-- The lower limit can fluctuate a bit, use 98%.
|
||||
check_result({before=before, after=after},
|
||||
pcall(ok, before.last * 98 / 100 < after.max))
|
||||
check_result({before=before, after=after},
|
||||
pcall(ok, before.last * 2 > after.max))
|
||||
-- In this case, garbage collecting is not needed.
|
||||
-- The value might fluctuate
|
||||
-- a bit, allow for 3% tolerance.
|
||||
-- The value might fluctuate a bit, allow for 3% tolerance.
|
||||
local lower = after.last * 97 / 100
|
||||
local upper = after.last * 103 / 100
|
||||
check_result({before=before, after=after}, pcall(ok, lower < after.max))
|
||||
|
Loading…
Reference in New Issue
Block a user