changeset 31780:8f15c56ff2fb v9.0.1222

patch 9.0.1222: terminal tests are flaky on MacOS Commit: https://github.com/vim/vim/commit/e446a017ffeaf1941589ac51ce9153b859018e5b Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Jan 19 17:49:58 2023 +0000 patch 9.0.1222: terminal tests are flaky on MacOS Problem: Terminal tests are flaky on MacOS. Solution: Add TermWait() calls. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/11852)
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Jan 2023 19:00:06 +0100
parents b2a3e51f40e6
children 3237c4baee03
files src/testdir/test_terminal2.vim src/testdir/test_terminal3.vim src/version.c
diffstat 3 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_terminal2.vim
+++ b/src/testdir/test_terminal2.vim
@@ -129,6 +129,7 @@ func Test_terminal_hidden_winsize()
   let cmd = GetDummyCmd()
   let rows = winheight(0)
   let buf = term_start(cmd, #{hidden: 1, term_rows: 10})
+  call TermWait(buf)
   call assert_equal(rows, winheight(0))
   call assert_equal([10, &columns], term_getsize(buf))
   exe "bwipe! " .. buf
@@ -196,6 +197,7 @@ func Test_terminal_out_err()
 
   let outfile = 'Xtermstdout'
   let buf = term_start(['./Xechoerrout.sh'], {'out_io': 'file', 'out_name': outfile})
+  call TermWait(buf)
 
   call WaitFor({-> !empty(readfile(outfile)) && !empty(term_getline(buf, 1))})
   call assert_equal(['this is standard out'], readfile(outfile))
@@ -216,6 +218,7 @@ func Test_termwinscroll()
   " will be dropped.
   exe 'set termwinscroll=' . &lines
   let buf = term_start('/bin/sh')
+  call TermWait(buf)
   for i in range(1, &lines)
     call feedkeys("echo " . i . "\<CR>", 'xt')
     call WaitForAssert({-> assert_match(string(i), term_getline(buf, term_getcursor(buf)[0] - 1))})
@@ -508,6 +511,7 @@ func Test_term_gettitle()
   endif
 
   let term = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', '-c', 'set title'])
+  call TermWait(term)
   " When Vim is running as a server then the title ends in VIM{number}, thus
   " optionally match a number after "VIM".
   call WaitForAssert({-> assert_match('^\[No Name\] - VIM\d*$', term_gettitle(term)) })
--- a/src/testdir/test_terminal3.vim
+++ b/src/testdir/test_terminal3.vim
@@ -18,6 +18,7 @@ func Test_terminal_altscreen()
   let cmd = "cat Xtext\<CR>"
 
   let buf = term_start(&shell, {})
+  call TermWait(buf)
   call writefile(["\<Esc>[?1047h"], 'Xtext', 'D')
   call term_sendkeys(buf, cmd)
   call WaitForAssert({-> assert_equal(1, term_getaltscreen(buf))})
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1222,
+/**/
     1221,
 /**/
     1220,