Patch 8.2.0021
Problem:    Timer test fails too often on Travis with MacOS.
Solution:   Be less strict with the time.
Files:      src/testdir/test_timers.vim


*** ../vim-8.2.0020/src/testdir/test_timers.vim 2019-09-08 21:15:44.000000000 
+0200
--- src/testdir/test_timers.vim 2019-12-18 20:09:41.017144530 +0100
***************
*** 19,28 ****
    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)
    else
!     call assert_inrange(20, 100, slept)
    endif
  endfunc
  
--- 19,34 ----
    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, limit, slept)
    else
!     call assert_inrange(20, limit, slept)
    endif
  endfunc
  
***************
*** 32,38 ****
    let slept = WaitFor('g:val == 3')
    call assert_equal(3, g:val)
    if has('reltime')
!     call assert_inrange(149, 250, slept)
    else
      call assert_inrange(80, 200, slept)
    endif
--- 38,49 ----
    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,49 ****
    let timer = timer_start(50, 'MyHandler', {'repeat': -1})
    sleep 200m
    call timer_stop(timer)
!   call assert_inrange(2, 5, g:val)
  endfunc
  
  func Test_timer_with_partial_callback()
--- 54,65 ----
    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,130 ****
    if has('reltime')
      if has('mac')
        " The travis Mac machines appear to be very busy.
!       call assert_inrange(0, 50, slept)
      else
        call assert_inrange(0, 30, slept)
      endif
--- 140,146 ----
    if has('reltime')
      if has('mac')
        " The travis Mac machines appear to be very busy.
!       call assert_inrange(0, 90, slept)
      else
        call assert_inrange(0, 30, slept)
      endif
*** ../vim-8.2.0020/src/version.c       2019-12-18 19:36:19.360023368 +0100
--- src/version.c       2019-12-18 20:06:02.749807316 +0100
***************
*** 744,745 ****
--- 744,747 ----
  {   /* Add new patch number below this line */
+ /**/
+     21,
  /**/

-- 
ARTHUR:      Who are you?
TALL KNIGHT: We are the Knights Who Say "Ni"!
BEDEVERE:    No!  Not the Knights Who Say "Ni"!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201912181910.xBIJAp3g012585%40masaka.moolenaar.net.

Raspunde prin e-mail lui