From 7ac46b5d37ae04d30031a217dafed5f6f8c733ac Mon Sep 17 00:00:00 2001 From: erw7 Date: Fri, 6 Sep 2019 00:37:03 +0900 Subject: [PATCH] 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 --- test/functional/legacy/memory_usage_spec.lua | 9 +++++---- 1 file 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)