diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-29 17:53:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-29 17:53:09 +0200 |
commit | e9f1bdabb877c47af8260ea680d7f748ab29b68d (patch) | |
tree | 77e10f7c0314ed2babaf092f4d37ec8e399a36af /test/functional/eval/timer_spec.lua | |
parent | e2ce5ff9d6168de0ffaf59d6bf20f20631a34a2d (diff) | |
download | rneovim-e9f1bdabb877c47af8260ea680d7f748ab29b68d.tar.gz rneovim-e9f1bdabb877c47af8260ea680d7f748ab29b68d.tar.bz2 rneovim-e9f1bdabb877c47af8260ea680d7f748ab29b68d.zip |
tests: fix flaky "timers can be stopped from the handler" (#10364)
Seen on Travis (osx):
[ RUN ] timers can be stopped from the handler: FAIL
.../build/neovim/neovim/test/functional/eval/timer_spec.lua:167: Expected objects to be the same.
Passed in:
(number) 2
Expected:
(number) 3
stack traceback:
.../build/neovim/neovim/test/functional/eval/timer_spec.lua:167: in function <.../build/neovim/neovim/test/functional/eval/timer_spec.lua:153>
Diffstat (limited to 'test/functional/eval/timer_spec.lua')
-rw-r--r-- | test/functional/eval/timer_spec.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index 877ce2c529..cd099e30ed 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -5,6 +5,7 @@ local source, nvim_async, run = helpers.source, helpers.nvim_async, helpers.run local clear, command, funcs = helpers.clear, helpers.command, helpers.funcs local curbufmeths = helpers.curbufmeths local load_adjust = helpers.load_adjust +local retry = helpers.retry describe('timers', function() before_each(function() @@ -161,10 +162,12 @@ describe('timers', function() endif endfunc ]]) - command("call timer_start(50, 'MyHandler', {'repeat': -1})") + command("call timer_start(10, 'MyHandler', {'repeat': -1})") eq(0,eval("g:val")) - run(nil, nil, nil, load_adjust(300)) - eq(3,eval("g:val")) + run(nil, nil, nil, load_adjust(50)) + retry(nil, 5000, function() + eq(3, eval("g:val")) + end) end) it('can have two timers', function() |