# HG changeset patch # User Bram Moolenaar # Date 1576696503 -3600 # Node ID a76fdc6560c36713950859e76154f1174d88c715 # Parent 78b1253f8c76a5b99715cc9e2dc3c747a9b2adbe patch 8.2.0021: timer test fails too often on Travis with MacOS Commit: https://github.com/vim/vim/commit/bc28e9f15bed94a7680a6bb84690965049da12d8 Author: Bram Moolenaar 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. diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim --- 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 21, +/**/ 20, /**/ 19,