1
0
forked from aniani/vim

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:
Bram Moolenaar
2021-04-04 15:28:59 +02:00
parent ceb0619433
commit 3a6aadb328
3 changed files with 6 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ endif
func StopShellInTerminal(buf)
call term_sendkeys(a:buf, "exit\r")
let job = term_getjob(a:buf)
call WaitFor({-> job_status(job) == "dead"})
call WaitForAssert({-> assert_equal("dead", job_status(job))})
endfunc
" Wrapper around term_wait() to allow more time for re-runs of flaky tests
@@ -160,7 +160,7 @@ endfunc
" number.
func Run_shell_in_terminal(options)
if has('win32')
let buf = term_start([&shell,'/k'], a:options)
let buf = term_start([&shell, '/k'], a:options)
else
let buf = term_start(&shell, a:options)
endif