Patch 8.2.2708

5 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 4, 2021, 9:29:36 AM4/4/21
to vim...@googlegroups.com

Patch 8.2.2708
Problem: Test sometimes fails waiting for shell in terminal.
Solution: Use WaitForAssert() so we can see the actual job status. Use
Run_shell_in_terminal().
Files: src/testdir/term_util.vim, src/testdir/test_mksession.vim


*** ../vim-8.2.2707/src/testdir/term_util.vim 2021-02-14 13:17:16.992007963 +0100
--- src/testdir/term_util.vim 2021-04-04 15:28:20.889158957 +0200
***************
*** 23,29 ****
func StopShellInTerminal(buf)
call term_sendkeys(a:buf, "exit\r")
let job = term_getjob(a:buf)
! call WaitFor({-> job_status(job) == "dead"})
endfunc

" Wrapper around term_wait() to allow more time for re-runs of flaky tests
--- 23,29 ----
func StopShellInTerminal(buf)
call term_sendkeys(a:buf, "exit\r")
let job = term_getjob(a:buf)
! call WaitForAssert({-> assert_equal("dead", job_status(job))})
endfunc

" Wrapper around term_wait() to allow more time for re-runs of flaky tests
***************
*** 160,166 ****
" number.
func Run_shell_in_terminal(options)
if has('win32')
! let buf = term_start([&shell,'/k'], a:options)
else
let buf = term_start(&shell, a:options)
endif
--- 160,166 ----
" number.
func Run_shell_in_terminal(options)
if has('win32')
! let buf = term_start([&shell, '/k'], a:options)
else
let buf = term_start(&shell, a:options)
endif
*** ../vim-8.2.2707/src/testdir/test_mksession.vim 2021-04-01 13:39:47.504992915 +0200
--- src/testdir/test_mksession.vim 2021-04-04 15:26:34.261439924 +0200
***************
*** 392,398 ****
func Test_mksession_terminal_no_restore_funcarg()
CheckFeature terminal

! call term_start(&shell, {'norestore': 1})
mksession! Xtest_mks.out
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
--- 392,398 ----
func Test_mksession_terminal_no_restore_funcarg()
CheckFeature terminal

! let buf = Run_shell_in_terminal({'norestore': 1})
mksession! Xtest_mks.out
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
***************
*** 402,408 ****
endif
endfor

! call StopShellInTerminal(bufnr('%'))
call delete('Xtest_mks.out')
endfunc

--- 402,408 ----
endif
endfor

! call StopShellInTerminal(buf)
call delete('Xtest_mks.out')
endfunc

*** ../vim-8.2.2707/src/version.c 2021-04-04 15:05:16.784805937 +0200
--- src/version.c 2021-04-04 15:23:34.317914103 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2708,
/**/

--
Keyboard not found. Think ENTER to continue.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages