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.
diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim
index f40213d..3eebad6 100644
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -162,8 +162,16 @@
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)