diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-18 20:10:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-18 20:10:23 +0100 |
commit | bc28e9f15bed94a7680a6bb84690965049da12d8 (patch) | |
tree | 2935aab4a3a6a9854d2ddb89a4848f776dbc8a4f | |
parent | f19f8d1a4b58ea83f3a356cb96a4bd90e7dc902e (diff) | |
download | vim-git-bc28e9f15bed94a7680a6bb84690965049da12d8.tar.gz |
patch 8.2.0021: timer test fails too often on Travis with MacOSv8.2.0021
Problem: Timer test fails too often on Travis with MacOS.
Solution: Be less strict with the time.
-rw-r--r-- | src/testdir/test_timers.vim | 26 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim index a6a36f793..a5df4b1b5 100644 --- 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 index a96c9066f..69341e0e5 100644 --- 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, |