0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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.
This commit is contained in:
Bram Moolenaar 2019-12-18 20:10:23 +01:00
parent f19f8d1a4b
commit bc28e9f15b
2 changed files with 24 additions and 6 deletions

View File

@ -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('reltime')
call assert_inrange(49, 100, slept)
if has('mac')
" Mac on Travis can be slow.
let limit = 160
else
call assert_inrange(20, 100, slept)
let limit = 100
endif
if has('reltime')
call assert_inrange(49, limit, slept)
else
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')
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)
" 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

View File

@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
21,
/**/
20,
/**/