mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.2708: test sometimes fails waiting for shell in terminal
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().
This commit is contained in:
@@ -23,7 +23,7 @@ endif
|
|||||||
func StopShellInTerminal(buf)
|
func StopShellInTerminal(buf)
|
||||||
call term_sendkeys(a:buf, "exit\r")
|
call term_sendkeys(a:buf, "exit\r")
|
||||||
let job = term_getjob(a:buf)
|
let job = term_getjob(a:buf)
|
||||||
call WaitFor({-> job_status(job) == "dead"})
|
call WaitForAssert({-> assert_equal("dead", job_status(job))})
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Wrapper around term_wait() to allow more time for re-runs of flaky tests
|
" Wrapper around term_wait() to allow more time for re-runs of flaky tests
|
||||||
@@ -160,7 +160,7 @@ endfunc
|
|||||||
" number.
|
" number.
|
||||||
func Run_shell_in_terminal(options)
|
func Run_shell_in_terminal(options)
|
||||||
if has('win32')
|
if has('win32')
|
||||||
let buf = term_start([&shell,'/k'], a:options)
|
let buf = term_start([&shell, '/k'], a:options)
|
||||||
else
|
else
|
||||||
let buf = term_start(&shell, a:options)
|
let buf = term_start(&shell, a:options)
|
||||||
endif
|
endif
|
||||||
|
@@ -392,7 +392,7 @@ endfunc
|
|||||||
func Test_mksession_terminal_no_restore_funcarg()
|
func Test_mksession_terminal_no_restore_funcarg()
|
||||||
CheckFeature terminal
|
CheckFeature terminal
|
||||||
|
|
||||||
call term_start(&shell, {'norestore': 1})
|
let buf = Run_shell_in_terminal({'norestore': 1})
|
||||||
mksession! Xtest_mks.out
|
mksession! Xtest_mks.out
|
||||||
let lines = readfile('Xtest_mks.out')
|
let lines = readfile('Xtest_mks.out')
|
||||||
let term_cmd = ''
|
let term_cmd = ''
|
||||||
@@ -402,7 +402,7 @@ func Test_mksession_terminal_no_restore_funcarg()
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
call StopShellInTerminal(bufnr('%'))
|
call StopShellInTerminal(buf)
|
||||||
call delete('Xtest_mks.out')
|
call delete('Xtest_mks.out')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2708,
|
||||||
/**/
|
/**/
|
||||||
2707,
|
2707,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user