aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/memory_usage_spec.lua
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-09-06 00:37:03 +0900
committererw7 <erw7.github@gmail.com>2020-05-07 16:48:08 +0900
commit7ac46b5d37ae04d30031a217dafed5f6f8c733ac (patch)
treef820cff976e108b1a6c7a15d81c4d9403a0bdb4b /test/functional/legacy/memory_usage_spec.lua
parenta32bac0c04215a867b941957c2dac89a719261cf (diff)
downloadrneovim-7ac46b5d37ae04d30031a217dafed5f6f8c733ac.tar.gz
rneovim-7ac46b5d37ae04d30031a217dafed5f6f8c733ac.tar.bz2
rneovim-7ac46b5d37ae04d30031a217dafed5f6f8c733ac.zip
vim-patch:8.1.1435: memory usage test is a bit too flaky
Problem: Memory usage test is a bit too flaky. Solution: Adjust the tolerances a bit. (Christian Brabandt) https://github.com/vim/vim/commit/5d508dd39e810d446f29dfd4f4e745b802875001
Diffstat (limited to 'test/functional/legacy/memory_usage_spec.lua')
-rw-r--r--test/functional/legacy/memory_usage_spec.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/functional/legacy/memory_usage_spec.lua b/test/functional/legacy/memory_usage_spec.lua
index d665c6c35c..28ca749749 100644
--- a/test/functional/legacy/memory_usage_spec.lua
+++ b/test/functional/legacy/memory_usage_spec.lua
@@ -101,15 +101,16 @@ describe('memory usage', function()
]])
local after = monitor_memory_usage(pid)
-- Estimate the limit of max usage as 2x initial usage.
- -- The lower limit can fluctuate a bit, use 98%.
+ -- The lower limit can fluctuate a bit, use 97%.
check_result({before=before, after=after},
- pcall(ok, before.last * 98 / 100 < after.max))
+ pcall(ok, before.last * 97 / 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 below and 5% above.
+ -- Based on various test runs.
local lower = after.last * 97 / 100
- local upper = after.last * 103 / 100
+ local upper = after.last * 105 / 100
check_result({before=before, after=after}, pcall(ok, lower < after.max))
check_result({before=before, after=after}, pcall(ok, after.max < upper))
end)