To: vim_dev@googlegroups.com Subject: Patch 9.0.0561 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0561 Problem: When a test gets stuck it just hangs forever. Solution: Set a timeout of 30 seconds. Files: src/testdir/runtest.vim *** ../vim-9.0.0560/src/testdir/runtest.vim 2022-09-23 19:42:27.814236815 +0100 --- src/testdir/runtest.vim 2022-09-23 20:22:57.288376414 +0100 *************** *** 186,191 **** --- 186,202 ---- let g:func_start = reltime() endif + " Invoked when a test takes too much time. + func TestTimeout(id) + split test.log + call append(line('$'), '') + call append(line('$'), 'Test timed out: ' .. g:testfunc) + write + call add(v:errors, 'Test timed out: ' . g:testfunc) + + cquit! 42 + endfunc + func RunTheTest(test) let prefix = '' if has('reltime') *************** *** 194,199 **** --- 205,216 ---- endif echoconsole prefix .. 'Executing ' .. a:test + if has('timers') + " No test should take longer than 30 seconds. If it takes longer we + " assume we are stuck and need to break out. + let test_timeout_timer = timer_start(30000, 'TestTimeout') + endif + " Avoid stopping at the "hit enter" prompt set nomore *************** *** 259,264 **** --- 276,285 ---- endtry endif + if has('timers') + call timer_stop(test_timeout_timer) + endif + " Clear any autocommands and put back the catch-all for SwapExists. au! au SwapExists * call HandleSwapExists() *** ../vim-9.0.0560/src/version.c 2022-09-23 19:42:27.814236815 +0100 --- src/version.c 2022-09-23 20:23:45.416301530 +0100 *************** *** 701,702 **** --- 701,704 ---- { /* Add new patch number below this line */ + /**/ + 561, /**/ -- hundred-and-one symptoms of being an internet addict: 146. You experience ACTUAL physical withdrawal symptoms when away from your 'puter and the net. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///