# HG changeset patch # User Bram Moolenaar # Date 1548791106 -3600 # Node ID 2973d8252740265fe2d0c97dafc0a8dec2e4b66f # Parent 6a059f8f3f176b65bce472b94df3dae6a2538182 patch 8.1.0844: when timer fails test will hang forever commit https://github.com/vim/vim/commit/50948e4ac24314d5a70404bbc592ffc28755ad9f Author: Bram Moolenaar 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) diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim --- 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 --- 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,