]> granicus.if.org Git - vim/commitdiff
patch 8.1.0844: when timer fails test will hang forever v8.1.0844
authorBram Moolenaar <Bram@vim.org>
Tue, 29 Jan 2019 19:36:56 +0000 (20:36 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 29 Jan 2019 19:36:56 +0000 (20:36 +0100)
Problem:    When timer fails test will hang forever.
Solution:   Use reltime() to limit waiting time. (Ozaki Kiichi, closes #3878)

src/testdir/test_timers.vim
src/version.c

index 2cea3e47dacb060f5f24feb3737d48731451aefc..78ec005676584c5a0e8800a6631784060c35463b 100644 (file)
@@ -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
index e78fde7dfb38a78cf7fb441aa2109ecaa1803773..cf7c47eb4222f472526cf55677d37de6006978b6 100644 (file)
@@ -783,6 +783,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    844,
 /**/
     843,
 /**/