Mercurial > vim
changeset 18920:a76fdc6560c3 v8.2.0021
patch 8.2.0021: timer test fails too often on Travis with MacOS
Commit: https://github.com/vim/vim/commit/bc28e9f15bed94a7680a6bb84690965049da12d8
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 18 20:10:23 2019 +0100
patch 8.2.0021: timer test fails too often on Travis with MacOS
Problem: Timer test fails too often on Travis with MacOS.
Solution: Be less strict with the time.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 18 Dec 2019 20:15:03 +0100 |
parents | 78b1253f8c76 |
children | 0be724789d54 |
files | src/testdir/test_timers.vim src/version.c |
diffstat | 2 files changed, 23 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_timers.vim +++ b/src/testdir/test_timers.vim @@ -19,10 +19,16 @@ func Test_timer_oneshot() let timer = timer_start(50, 'MyHandler') let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) + if has('mac') + " Mac on Travis can be slow. + let limit = 160 + else + let limit = 100 + endif if has('reltime') - call assert_inrange(49, 100, slept) + call assert_inrange(49, limit, slept) else - call assert_inrange(20, 100, slept) + call assert_inrange(20, limit, slept) endif endfunc @@ -32,7 +38,12 @@ func Test_timer_repeat_three() let slept = WaitFor('g:val == 3') call assert_equal(3, g:val) if has('reltime') - call assert_inrange(149, 250, slept) + if has('mac') + " Mac on Travis can be slow. + call assert_inrange(149, 400, slept) + else + call assert_inrange(149, 250, slept) + endif else call assert_inrange(80, 200, slept) endif @@ -43,7 +54,12 @@ func Test_timer_repeat_many() let timer = timer_start(50, 'MyHandler', {'repeat': -1}) sleep 200m call timer_stop(timer) - call assert_inrange(2, 5, g:val) + " Mac on Travis can be slow. + if has('mac') + call assert_inrange(1, 5, g:val) + else + call assert_inrange(2, 5, g:val) + endif endfunc func Test_timer_with_partial_callback() @@ -124,7 +140,7 @@ func Test_timer_paused() if has('reltime') if has('mac') " The travis Mac machines appear to be very busy. - call assert_inrange(0, 50, slept) + call assert_inrange(0, 90, slept) else call assert_inrange(0, 30, slept) endif