]> granicus.if.org Git - vim/commitdiff
patch 8.1.1867: still a timer test that is flaky on Mac v8.1.1867
authorBram Moolenaar <Bram@vim.org>
Sat, 17 Aug 2019 11:18:16 +0000 (13:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 17 Aug 2019 11:18:16 +0000 (13:18 +0200)
Problem:    Still a timer test that is flaky on Mac.
Solution:   Loop with a sleep instead of one fixed sleep.

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

index f40213dddac62cca114bdb2eb218b1aa46311f3f..3eebad66c3bd759d309ab00bbbc9fa18a4a5ea61 100644 (file)
@@ -162,8 +162,16 @@ endfunc
 func Test_timer_stop_in_callback()
   call assert_equal(0, len(timer_info()))
   let g:timer1 = timer_start(10, 'StopTimer1')
-  sleep 50m
-  call assert_equal(0, len(timer_info()))
+  let slept = 0
+  for i in range(10)
+    if len(timer_info()) == 0
+      break
+    endif
+    sleep 10m
+    let slept += 10
+  endfor
+  " This should take only 30 msec, but on Mac it's often longer
+  call assert_inrange(0, 50, slept)
 endfunc
 
 func StopTimerAll(timer)
index 4b3637c47a0c8cce218a7d857dc5a0118c293b81..a885d9e4162b10915b4ad72b210c33995027fff6 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1867,
 /**/
     1866,
 /**/