summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-17 13:18:16 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-17 13:18:16 +0200
commit315244d85b9b8faae549b1700e8cc2e45eaa68ea (patch)
tree29da5a073f5d3199770b208d717411698ae07ce5 /src/testdir
parentd5cf89872e6185c4d97cd254a9d697b8c3bdbf94 (diff)
downloadvim-git-315244d85b9b8faae549b1700e8cc2e45eaa68ea.tar.gz
patch 8.1.1867: still a timer test that is flaky on Macv8.1.1867
Problem: Still a timer test that is flaky on Mac. Solution: Loop with a sleep instead of one fixed sleep.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_timers.vim12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim
index f40213ddd..3eebad66c 100644
--- 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)