]> granicus.if.org Git - vim/commitdiff
patch 8.2.2708: test sometimes fails waiting for shell in terminal v8.2.2708
authorBram Moolenaar <Bram@vim.org>
Sun, 4 Apr 2021 13:28:59 +0000 (15:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 4 Apr 2021 13:28:59 +0000 (15:28 +0200)
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().

src/testdir/term_util.vim
src/testdir/test_mksession.vim
src/version.c

index 8541ef353bb225e049b3452d27419961022acb71..de87dd420e96ba1857ad78ec3ee49f490108df8b 100644 (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
index 29d4360f012bff9ddbb83b31b7b6bef868b560de..fca1227d5fb09afa826f2a06c104c20738445cf3 100644 (file)
@@ -392,7 +392,7 @@ endfunc
 func Test_mksession_terminal_no_restore_funcarg()
   CheckFeature terminal
 
-  call term_start(&shell, {'norestore': 1})
+  let buf = Run_shell_in_terminal({'norestore': 1})
   mksession! Xtest_mks.out
   let lines = readfile('Xtest_mks.out')
   let term_cmd = ''
@@ -402,7 +402,7 @@ func Test_mksession_terminal_no_restore_funcarg()
     endif
   endfor
 
-  call StopShellInTerminal(bufnr('%'))
+  call StopShellInTerminal(buf)
   call delete('Xtest_mks.out')
 endfunc
 
index 754e6072fc879ad0c0b645981fbef2a02feafc03..2b0955c5a8feeb907a6bf82d2c9c84d683371987 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2708,
 /**/
     2707,
 /**/