comparison src/testdir/test_memory_usage.vim @ 16107:b951bea7d11e v8.1.1058

patch 8.1.1058: memory usage test may still fail on some systems commit https://github.com/vim/vim/commit/3a731ee0c2dd34792c1b21fc4c699a84129f1b86 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 27 21:41:36 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Wed, 27 Mar 2019 21:45:05 +0100
parents e4ba2925b54d
children 0baa4c7e057f
comparison
equal deleted inserted replaced
16106:b08497568647 16107:b951bea7d11e
95 call term_sendkeys(vim.buf, ":so %\<CR>") 95 call term_sendkeys(vim.buf, ":so %\<CR>")
96 call WaitFor({-> term_getcursor(vim.buf)[0] == 1}) 96 call WaitFor({-> term_getcursor(vim.buf)[0] == 1})
97 let after = s:monitor_memory_usage(vim.pid) 97 let after = s:monitor_memory_usage(vim.pid)
98 98
99 " Estimate the limit of max usage as 2x initial usage. 99 " Estimate the limit of max usage as 2x initial usage.
100 call assert_inrange(before, 2 * before, after.max) 100 " The lower limit can fluctuate a bit, use 98%.
101 " In this case, garbage collecting is not needed. The value might fluctuate 101 call assert_inrange(before * 98 / 100, 2 * before, after.max)
102 " a bit, allow for 3% tolerance. 102
103 " In this case, garbage collecting is not needed.
104 " The value might fluctuate a bit, allow for 3% tolerance.
103 let lower = after.last * 97 / 100 105 let lower = after.last * 97 / 100
104 let upper = after.last * 103 / 100 106 let upper = after.last * 103 / 100
105 call assert_inrange(lower, upper, after.max) 107 call assert_inrange(lower, upper, after.max)
106 108
107 call vim.stop() 109 call vim.stop()