diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-08-02 20:19:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-02 20:19:48 +0200 |
commit | 4ed5204bc9d5811cd45209476ac1b9e2c2b74146 (patch) | |
tree | b3d811af95576072856a07f0dffcb86c76de6604 /test/functional/legacy/memory_usage_spec.lua | |
parent | 480515e4426865c37a42a452432b3463f0ab40a7 (diff) | |
parent | ea515f8ca1fa63cfad516a956cd78ef371f91955 (diff) | |
download | rneovim-4ed5204bc9d5811cd45209476ac1b9e2c2b74146.tar.gz rneovim-4ed5204bc9d5811cd45209476ac1b9e2c2b74146.tar.bz2 rneovim-4ed5204bc9d5811cd45209476ac1b9e2c2b74146.zip |
Merge pull request #12665 from janlazo/vim-8.2.1254
vim-patch:8.0.1774,8.1.{192,194,255,264,1202,2172,2340},8.2.{62,71,72,1004,1254,1259,1265,1267,1292,1295}
Diffstat (limited to 'test/functional/legacy/memory_usage_spec.lua')
-rw-r--r-- | test/functional/legacy/memory_usage_spec.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/functional/legacy/memory_usage_spec.lua b/test/functional/legacy/memory_usage_spec.lua index 28ca749749..251e6a5ea4 100644 --- a/test/functional/legacy/memory_usage_spec.lua +++ b/test/functional/legacy/memory_usage_spec.lua @@ -7,6 +7,9 @@ local iswin = helpers.iswin local retry = helpers.retry local ok = helpers.ok local source = helpers.source +local wait = helpers.wait +local uname = helpers.uname +local load_adjust = helpers.load_adjust local monitor_memory_usage = { memory_usage = function(self) @@ -99,6 +102,7 @@ describe('memory usage', function() call s:f(0) endfor ]]) + wait() local after = monitor_memory_usage(pid) -- Estimate the limit of max usage as 2x initial usage. -- The lower limit can fluctuate a bit, use 97%. @@ -143,16 +147,20 @@ describe('memory usage', function() call s:f() endfor ]]) + wait() local after = monitor_memory_usage(pid) for _ = 1, 3 do feed_command('so '..fname) + wait() end local last = monitor_memory_usage(pid) -- 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 - -- 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 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}, pcall(ok, lower < last.last)) check_result({before=before, after=after, last=last}, |