diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-03 22:48:53 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-03 22:49:05 -0500 |
commit | d139fb5cd08a9bdee30e0735e9e795585036ce7b (patch) | |
tree | 22133c5bffbedd69c9adfdfb15ae05d8b6e366ec | |
parent | 25613fa65bf1c3bbe2b675ff273acb94f47656bc (diff) | |
download | rneovim-d139fb5cd08a9bdee30e0735e9e795585036ce7b.tar.gz rneovim-d139fb5cd08a9bdee30e0735e9e795585036ce7b.tar.bz2 rneovim-d139fb5cd08a9bdee30e0735e9e795585036ce7b.zip |
vim-patch:8.1.0844: when timer fails test will hang forever
Problem: When timer fails test will hang forever.
Solution: Use reltime() to limit waiting time. (Ozaki Kiichi, closes vim/vim#3878)
https://github.com/vim/vim/commit/50948e4ac24314d5a70404bbc592ffc28755ad9f
-rw-r--r-- | src/nvim/testdir/test_timers.vim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index e4d9329ac6..6c336e6fa6 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -260,9 +260,11 @@ func Test_getchar_zero() return endif + " Measure the elapsed time to avoid a hang when it fails. + let start = reltime() let id = timer_start(20, {id -> feedkeys('x', 'L')}) let c = 0 - while c == 0 + while c == 0 && reltimefloat(reltime(start)) < 0.2 let c = getchar(0) sleep 10m endwhile |