I wrote:
> 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
This is very weird. After including this patch a cscope test started
failing. The error message is confusing, pointing to line 599 of
testdir/runtest.vim, which does not exist. Running "make test_csope"
gets the same error every time.
Removing the added line makes the test pass again. However,
commenting-out the lines does not! Thus it's not the commands that
cause the problem, but the added text in the function. Deleting some
text, without changing the number of lines, makes it work OK again.
Weird!
I tried a few other things, but could not find out much more. It does
seem related to the fork/exec that cscope does to run cscope, which
fails because the command name is wrong. Perhaps something with signal
handling?
If someone likes a puzzle, please have a look at this.
>
> *** ../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 -- [email protected] -- http://www.Moolenaar.net \\\
> /// \\\
> \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
> \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_dev/20220923192747.826AC1C063B%40moolenaar.net.
--
hundred-and-one symptoms of being an internet addict:
152. You find yourself falling for someone you've never seen or hardly
know, but, boy can he/she TYPE!!!!!!
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220924091526.A60151C0728%40moolenaar.net.