changeset 15673:2973d8252740 v8.1.0844

patch 8.1.0844: when timer fails test will hang forever commit https://github.com/vim/vim/commit/50948e4ac24314d5a70404bbc592ffc28755ad9f Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 29 20:36:56 2019 +0100 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 https://github.com/vim/vim/issues/3878)
author Bram Moolenaar <Bram@vim.org>
date Tue, 29 Jan 2019 20:45:06 +0100
parents 6a059f8f3f17
children 9045c248e9eb
files src/testdir/test_timers.vim src/version.c
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -257,9 +257,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
--- a/src/version.c
+++ b/src/version.c
@@ -784,6 +784,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    844,
+/**/
     843,
 /**/
     842,