changeset 17740:01205ef5646d v8.1.1867

patch 8.1.1867: still a timer test that is flaky on Mac commit https://github.com/vim/vim/commit/315244d85b9b8faae549b1700e8cc2e45eaa68ea Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 17 13:18:16 2019 +0200 patch 8.1.1867: still a timer test that is flaky on Mac Problem: Still a timer test that is flaky on Mac. Solution: Loop with a sleep instead of one fixed sleep.
author Bram Moolenaar <Bram@vim.org>
date Sat, 17 Aug 2019 13:30:04 +0200
parents 0ea79ae89615
children 5b329791d09a
files src/testdir/test_timers.vim src/version.c
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -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)
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1867,
+/**/
     1866,
 /**/
     1865,