]> granicus.if.org Git - vim/commitdiff
patch 8.2.0021: timer test fails too often on Travis with MacOS v8.2.0021
authorBram Moolenaar <Bram@vim.org>
Wed, 18 Dec 2019 19:10:23 +0000 (20:10 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 18 Dec 2019 19:10:23 +0000 (20:10 +0100)
Problem:    Timer test fails too often on Travis with MacOS.
Solution:   Be less strict with the time.

src/testdir/test_timers.vim
src/version.c

index a6a36f793e8866afa1a1ff873140139910b53e8c..a5df4b1b5d9c431ce5d5d34a42a28529853d0019 100644 (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('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
index a96c9066f5ad6aa0ae1f48869ca2aaec81dfb277..69341e0e59d295567809e0b2aa1ea47baba60981 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    21,
 /**/
     20,
 /**/