Mercurial > vim
comparison src/testdir/test_timers.vim @ 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 | c92899aa761a |
children | 8a2fb21c23c0 |
comparison
equal
deleted
inserted
replaced
17739:0ea79ae89615 | 17740:01205ef5646d |
---|---|
160 endfunc | 160 endfunc |
161 | 161 |
162 func Test_timer_stop_in_callback() | 162 func Test_timer_stop_in_callback() |
163 call assert_equal(0, len(timer_info())) | 163 call assert_equal(0, len(timer_info())) |
164 let g:timer1 = timer_start(10, 'StopTimer1') | 164 let g:timer1 = timer_start(10, 'StopTimer1') |
165 sleep 50m | 165 let slept = 0 |
166 call assert_equal(0, len(timer_info())) | 166 for i in range(10) |
167 if len(timer_info()) == 0 | |
168 break | |
169 endif | |
170 sleep 10m | |
171 let slept += 10 | |
172 endfor | |
173 " This should take only 30 msec, but on Mac it's often longer | |
174 call assert_inrange(0, 50, slept) | |
167 endfunc | 175 endfunc |
168 | 176 |
169 func StopTimerAll(timer) | 177 func StopTimerAll(timer) |
170 call timer_stopall() | 178 call timer_stopall() |
171 endfunc | 179 endfunc |