From: Bram Moolenaar Date: Tue, 29 Jan 2019 19:36:56 +0000 (+0100) Subject: patch 8.1.0844: when timer fails test will hang forever X-Git-Tag: v8.1.0844 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50948e4ac24314d5a70404bbc592ffc28755ad9f;p=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 #3878) --- diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim index 2cea3e47d..78ec00567 100644 --- 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 diff --git a/src/version.c b/src/version.c index e78fde7df..cf7c47eb4 100644 --- a/src/version.c +++ b/src/version.c @@ -783,6 +783,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 844, /**/ 843, /**/