mirror of
https://github.com/neovim/neovim.git
synced 2025-11-04 17:54:30 +00: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:
@@ -101,11 +101,13 @@ describe('memory usage', function()
|
|||||||
]])
|
]])
|
||||||
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.
|
||||||
check_result({before=before, after=after}, pcall(ok, before.last < after.max))
|
-- The lower limit can fluctuate a bit, use 98%.
|
||||||
check_result({before=before, after=after}, pcall(ok, before.last * 2 > after.max))
|
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.
|
-- In this case, garbage collecting is not needed.
|
||||||
-- The value might fluctuate
|
-- The value might fluctuate a bit, allow for 3% tolerance.
|
||||||
-- a bit, allow for 3% tolerance.
|
|
||||||
local lower = after.last * 97 / 100
|
local lower = after.last * 97 / 100
|
||||||
local upper = after.last * 103 / 100
|
local upper = after.last * 103 / 100
|
||||||
check_result({before=before, after=after}, pcall(ok, lower < after.max))
|
check_result({before=before, after=after}, pcall(ok, lower < after.max))
|
||||||
|
|||||||
Reference in New Issue
Block a user