From: Bram Moolenaar Date: Sat, 17 Aug 2019 11:18:16 +0000 (+0200) Subject: patch 8.1.1867: still a timer test that is flaky on Mac X-Git-Tag: v8.1.1867 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=315244d85b9b8faae549b1700e8cc2e45eaa68ea;p=vim 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 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) diff --git a/src/version.c b/src/version.c index 4b3637c47..a885d9e41 100644 --- a/src/version.c +++ b/src/version.c @@ -769,6 +769,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1867, /**/ 1866, /**/