summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-08 21:50:25 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-08 21:50:25 +0200
commit6a2c5a7dd5c9215cc030d5ea6e4616d782c091dd (patch)
treec3c2d559b959ba7b6776212f5e071683b8079a96 /src/testdir
parent7035fd9d909c49cf5105a53753c1772c193d05b8 (diff)
patch 8.2.0533: tests using term_wait() can still be flakyv8.2.0533
Problem: Tests using term_wait() can still be flaky. Solution: Increase the wait time when rerunning a test. (James McCoy, closes #5899) Halve the initial times to make tests run faster when there is no rerun.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/term_util.vim17
-rw-r--r--src/testdir/test_arglist.vim8
-rw-r--r--src/testdir/test_autocmd.vim10
-rw-r--r--src/testdir/test_balloon.vim6
-rw-r--r--src/testdir/test_bufline.vim2
-rw-r--r--src/testdir/test_channel.vim2
-rw-r--r--src/testdir/test_cmdline.vim6
-rw-r--r--src/testdir/test_conceal.vim2
-rw-r--r--src/testdir/test_cursorline.vim32
-rw-r--r--src/testdir/test_debugger.vim2
-rw-r--r--src/testdir/test_diffmode.vim2
-rw-r--r--src/testdir/test_display.vim2
-rw-r--r--src/testdir/test_functions.vim19
-rw-r--r--src/testdir/test_highlight.vim12
-rw-r--r--src/testdir/test_ins_complete.vim6
-rw-r--r--src/testdir/test_mapping.vim6
-rw-r--r--src/testdir/test_match.vim2
-rw-r--r--src/testdir/test_matchadd_conceal.vim8
-rw-r--r--src/testdir/test_messages.vim4
-rw-r--r--src/testdir/test_number.vim2
-rw-r--r--src/testdir/test_popup.vim8
-rw-r--r--src/testdir/test_popupwin.vim16
-rw-r--r--src/testdir/test_profile.vim2
-rw-r--r--src/testdir/test_search.vim16
-rw-r--r--src/testdir/test_search_stat.vim4
-rw-r--r--src/testdir/test_startup.vim4
-rw-r--r--src/testdir/test_startup_utf8.vim2
-rw-r--r--src/testdir/test_statusline.vim2
-rw-r--r--src/testdir/test_suspend.vim2
-rw-r--r--src/testdir/test_swap.vim6
-rw-r--r--src/testdir/test_tagjump.vim2
-rw-r--r--src/testdir/test_terminal.vim108
-rw-r--r--src/testdir/test_terminal_fail.vim2
-rw-r--r--src/testdir/test_timers.vim4
-rw-r--r--src/testdir/test_vimscript.vim12
35 files changed, 173 insertions, 167 deletions
diff --git a/src/testdir/term_util.vim b/src/testdir/term_util.vim
index 32e2889140..715a4ac760 100644
--- a/src/testdir/term_util.vim
+++ b/src/testdir/term_util.vim
@@ -24,6 +24,21 @@ func StopShellInTerminal(buf)
call WaitFor({-> job_status(job) == "dead"})
endfunc
+" Wrapper around term_wait() to allow more time for re-runs of flaky tests
+" The second argument is the minimum time to wait in msec, 10 if omitted.
+func TermWait(buf, ...)
+ let wait_time = a:0 ? a:1 : 10
+ if g:run_nr == 2
+ let wait_time *= 4
+ elseif g:run_nr > 2
+ let wait_time *= 10
+ endif
+ call term_wait(a:buf, wait_time)
+
+ " In case it wasn't set yet.
+ let g:test_is_flaky = 1
+endfunc
+
" Run Vim with "arguments" in a new terminal window.
" By default uses a size of 20 lines and 75 columns.
" Returns the buffer number of the terminal.
@@ -82,7 +97,7 @@ func RunVimInTerminal(arguments, options)
let cols = term_getsize(buf)[1]
endif
- call term_wait(buf)
+ call TermWait(buf)
" Wait for "All" or "Top" of the ruler to be shown in the last line or in
" the status line of the last window. This can be quite slow (e.g. when
diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim
index d73a3ccc27..aa81b57959 100644
--- a/src/testdir/test_arglist.vim
+++ b/src/testdir/test_arglist.vim
@@ -518,7 +518,7 @@ func Test_quit_with_arglist()
call term_sendkeys(buf, ":set nomore\n")
call term_sendkeys(buf, ":args a b c\n")
call term_sendkeys(buf, ":quit\n")
- call term_wait(buf)
+ call TermWait(buf)
call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))})
call StopVimInTerminal(buf)
@@ -527,16 +527,16 @@ func Test_quit_with_arglist()
call term_sendkeys(buf, ":set nomore\n")
call term_sendkeys(buf, ":args a b c\n")
call term_sendkeys(buf, ":confirm quit\n")
- call term_wait(buf)
+ call TermWait(buf)
call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$',
\ term_getline(buf, 6))})
call term_sendkeys(buf, "N")
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, ":confirm quit\n")
call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$',
\ term_getline(buf, 6))})
call term_sendkeys(buf, "Y")
- call term_wait(buf)
+ call TermWait(buf)
call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))})
only!
" When this test fails, swap files are left behind which breaks subsequent
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index f798916211..a8648f8c49 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -1761,9 +1761,9 @@ function s:Before_test_dirchanged()
augroup END
let s:li = []
let s:dir_this = getcwd()
- let s:dir_foo = s:dir_this . '/foo'
+ let s:dir_foo = s:dir_this . '/Xfoo'
call mkdir(s:dir_foo)
- let s:dir_bar = s:dir_this . '/bar'
+ let s:dir_bar = s:dir_this . '/Xbar'
call mkdir(s:dir_bar)
endfunc
@@ -2291,9 +2291,9 @@ func Test_autocmd_SafeState()
call WaitForAssert({-> assert_match('^xxx', term_getline(buf, 6))}, 1000)
call term_sendkeys(buf, ":let g:again = ''\<CR>:call CallTimer()\<CR>")
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":\<CR>")
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":echo g:again\<CR>")
call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000)
@@ -2317,7 +2317,7 @@ func Test_autocmd_CmdWinEnter()
let buf = RunVimInTerminal('-S '.filename, #{rows: 6})
call term_sendkeys(buf, "q:")
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, ":echo b:dummy_var\<cr>")
call WaitForAssert({-> assert_match('^This is a dummy', term_getline(buf, 6))}, 2000)
call term_sendkeys(buf, ":echo &buftype\<cr>")
diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim
index f32b73c0d4..bb22f7bf2e 100644
--- a/src/testdir/test_balloon.vim
+++ b/src/testdir/test_balloon.vim
@@ -32,14 +32,14 @@ func Test_balloon_eval_term()
" Check that the balloon shows up after a mouse move
let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, 'll')
call term_sendkeys(buf, ":call Trigger()\<CR>")
call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {})
" Make sure the balloon still shows after 'updatetime' passed and CursorHold
" was triggered.
- call term_wait(buf, 300)
+ call TermWait(buf, 150)
call VerifyScreenDump(buf, 'Test_balloon_eval_term_01a', {})
" clean up
@@ -57,7 +57,7 @@ func Test_balloon_eval_term_visual()
" Check that the balloon shows up after a mouse move
let buf = RunVimInTerminal('-S XTest_beval_visual', {'rows': 10, 'cols': 50})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_balloon_eval_term_02', {})
" clean up
diff --git a/src/testdir/test_bufline.vim b/src/testdir/test_bufline.vim
index 3c3c89c618..a863ba5d3a 100644
--- a/src/testdir/test_bufline.vim
+++ b/src/testdir/test_bufline.vim
@@ -164,7 +164,7 @@ func Test_appendbufline_redraw()
END
call writefile(lines, 'XscriptMatchCommon')
let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10})
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_appendbufline_1', {})
call StopVimInTerminal(buf)
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index dac90aa0e7..0cabd5c1af 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1062,7 +1062,7 @@ func Test_write_to_buffer_and_scroll()
END
call writefile(lines, 'XtestBufferScroll')
let buf = RunVimInTerminal('-S XtestBufferScroll', #{rows: 10})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call VerifyScreenDump(buf, 'Test_job_buffer_scroll_1', {})
" clean up
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index e2b7fc298f..8aabaa859d 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -947,7 +947,7 @@ func Test_verbose_option()
call writefile(lines, 'XTest_verbose')
let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":DoSomething\<CR>")
call VerifyScreenDump(buf, 'Test_verbose_option_1', {})
@@ -1024,7 +1024,7 @@ func Test_cmdwin_restore()
call writefile(lines, 'XTest_restore')
let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, "q:")
call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {})
@@ -1146,7 +1146,7 @@ func Test_cmdlineclear_tabenter()
call writefile(lines, 'XtestCmdlineClearTabenter')
let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10})
- call term_wait(buf, 50)
+ call TermWait(buf, 25)
" in one tab make the command line higher with CTRL-W -
call term_sendkeys(buf, ":tabnew\<cr>\<C-w>-\<C-w>-gtgt")
call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {})
diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim
index af0c3b8f79..bf942b7880 100644
--- a/src/testdir/test_conceal.vim
+++ b/src/testdir/test_conceal.vim
@@ -147,7 +147,7 @@ func Test_conceal_resize_term()
call VerifyScreenDump(buf, 'Test_conceal_resize_01', {})
call win_execute(buf->win_findbuf()[0], 'wincmd +')
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_conceal_resize_02', {})
" clean up
diff --git a/src/testdir/test_cursorline.vim b/src/testdir/test_cursorline.vim
index d4a03afd38..03e7306d67 100644
--- a/src/testdir/test_cursorline.vim
+++ b/src/testdir/test_cursorline.vim
@@ -135,41 +135,41 @@ func Test_cursorline_screenline()
call writefile(lines, filename)
" basic test
let buf = RunVimInTerminal('-S '. filename, #{rows: 20})
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_1', {})
call term_sendkeys(buf, "fagj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_2', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_3', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_4', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_5', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_6', {})
" test with set list and cursorlineopt containing number
call term_sendkeys(buf, "gg0")
call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\<cr>")
call VerifyScreenDump(buf, 'Test_'. filename. '_7', {})
call term_sendkeys(buf, "fagj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_8', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_9', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_10', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_11', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_12', {})
if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent")
" test with set foldcolumn signcoloumn and breakindent
@@ -177,19 +177,19 @@ func Test_cursorline_screenline()
call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>")
call VerifyScreenDump(buf, 'Test_'. filename. '_13', {})
call term_sendkeys(buf, "fagj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_14', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_15', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_16', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_17', {})
call term_sendkeys(buf, "gj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_18', {})
endif
diff --git a/src/testdir/test_debugger.vim b/src/testdir/test_debugger.vim
index 8ba3998f3f..a99154a5af 100644
--- a/src/testdir/test_debugger.vim
+++ b/src/testdir/test_debugger.vim
@@ -8,7 +8,7 @@ source check.vim
" If the expected output argument is supplied, then check for it.
func RunDbgCmd(buf, cmd, ...)
call term_sendkeys(a:buf, a:cmd . "\r")
- call term_wait(a:buf, 20)
+ call TermWait(a:buf)
if a:0 != 0
" Verify the expected output
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 07aa919f4c..a251d3fec2 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -801,7 +801,7 @@ func VerifyInternal(buf, dumpfile, extra)
call term_sendkeys(a:buf, ":diffupdate!\<CR>")
" trailing : for leaving the cursor on the command line
call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:")
- call term_wait(a:buf)
+ call TermWait(a:buf)
call VerifyScreenDump(a:buf, a:dumpfile, {})
endfunc
diff --git a/src/testdir/test_display.vim b/src/testdir/test_display.vim
index f439bfe272..1093641783 100644
--- a/src/testdir/test_display.vim
+++ b/src/testdir/test_display.vim
@@ -174,7 +174,7 @@ func Test_scroll_CursorLineNr_update()
call writefile(lines, filename)
let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50})
call term_sendkeys(buf, "k")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_winline_rnu', {})
" clean up
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index 2cf90061a8..3b9e34c191 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -1858,15 +1858,6 @@ endfunc
func Test_state()
CheckRunVimInTerminal
- " In the first run try a short wait time. If the test fails retry with a
- " longer wait time.
- if g:run_nr == 1
- let wait_time = 50
- elseif g:run_nr == 2
- let wait_time = 200
- else
- let wait_time = 500
- endif
let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\<CR>"
let lines =<< trim END
@@ -1888,27 +1879,27 @@ func Test_state()
" Using a timer callback
call term_sendkeys(buf, ":call RunTimer()\<CR>")
- call term_wait(buf, wait_time)
+ call TermWait(buf, 25)
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: c; mode: n', term_getline(buf, 6))}, 1000)
" Halfway a mapping
call term_sendkeys(buf, ":call RunTimer()\<CR>;")
- call term_wait(buf, wait_time)
+ call TermWait(buf, 25)
call term_sendkeys(buf, ";")
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000)
" Insert mode completion (bit slower on Mac)
call term_sendkeys(buf, ":call RunTimer()\<CR>Got\<C-N>")
- call term_wait(buf, wait_time)
+ call TermWait(buf, 25)
call term_sendkeys(buf, "\<Esc>")
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: aSc; mode: i', term_getline(buf, 6))}, 1000)
" Autocommand executing
call term_sendkeys(buf, ":set filetype=foobar\<CR>")
- call term_wait(buf, wait_time)
+ call TermWait(buf, 25)
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: xS; mode: n', term_getline(buf, 6))}, 1000)
@@ -1916,7 +1907,7 @@ func Test_state()
" messages scrolled
call term_sendkeys(buf, ":call RunTimer()\<CR>:echo \"one\\ntwo\\nthree\"\<CR>")
- call term_wait(buf, wait_time)
+ call TermWait(buf, 25)
call term_sendkeys(buf, "\<CR>")
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: Scs; mode: r', term_getline(buf, 6))}, 1000)
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim
index dfc9e24212..73b72289e6 100644
--- a/src/testdir/test_highlight.vim
+++ b/src/testdir/test_highlight.vim
@@ -542,9 +542,9 @@ func Test_cursorline_after_yank()
\ 'call setline(1, ["","1","2","3",""])',
\ ], 'Xtest_cursorline_yank')
let buf = RunVimInTerminal('-S Xtest_cursorline_yank', {'rows': 8})
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "Gy3k")
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "jj")
call VerifyScreenDump(buf, 'Test_cursorline_yank_01', {})
@@ -582,7 +582,7 @@ func Test_cursorline_with_visualmode()
\ 'call setline(1, repeat(["abc"], 50))',
\ ], 'Xtest_cursorline_with_visualmode')
let buf = RunVimInTerminal('-S Xtest_cursorline_with_visualmode', {'rows': 12})
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "V\<C-f>kkkjk")
call VerifyScreenDump(buf, 'Test_cursorline_with_visualmode_01', {})
@@ -610,9 +610,9 @@ func Test_wincolor()
END
call writefile(lines, 'Xtest_wincolor')
let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8})
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "2G5lvj")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_wincolor_01', {})
@@ -662,7 +662,7 @@ func Test_colorcolumn()
call writefile(lines, 'Xtest_colorcolumn')
let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10})
call term_sendkeys(buf, ":\<CR>")
- call term_wait(buf)
+ call TermWait(buf)
call VerifyScreenDump(buf, 'Test_colorcolumn_1', {})
" clean up
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index b7893fffbe..a1c7b98f18 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -402,7 +402,7 @@ func Test_pum_with_folds_two_tabs()
call writefile(lines, 'Xpumscript')
let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, "a\<C-N>")
call VerifyScreenDump(buf, 'Test_pum_with_folds_two_tabs', {})
@@ -427,9 +427,9 @@ func Test_pum_with_preview_win()
call writefile(lines, 'Xpreviewscript')
let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, "Gi\<C-X>\<C-O>")
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
call term_sendkeys(buf, "\<C-N>")
call VerifyScreenDump(buf, 'Test_pum_with_preview_win', {})
diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim
index 71f254a780..f6e712406c 100644
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -430,9 +430,9 @@ func Test_error_in_map_expr()
" GC must not run during map-expr processing, which can make Vim crash.
call term_sendkeys(buf, '!')
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, "\<CR>")
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call assert_equal('run', job_status(job))
call term_sendkeys(buf, ":qall!\<CR>")
@@ -510,7 +510,7 @@ func Test_expr_map_restore_cursor()
END
call writefile(lines, 'XtestExprMap')
let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "\<C-B>")
call VerifyScreenDump(buf, 'Test_map_expr_1', {})
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim
index 59098f7136..cd8ae2eb56 100644
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -289,7 +289,7 @@ func OtherWindowCommon()
END
call writefile(lines, 'XscriptMatchCommon')
let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12})
- call term_wait(buf)
+ call TermWait(buf)
return buf
endfunc
diff --git a/src/testdir/test_matchadd_conceal.vim b/src/testdir/test_matchadd_conceal.vim
index 7c02087e23..be154643e6 100644
--- a/src/testdir/test_matchadd_conceal.vim
+++ b/src/testdir/test_matchadd_conceal.vim
@@ -298,14 +298,14 @@ func Test_cursor_column_in_concealed_line_after_window_scroll()
END
call writefile(lines, 'Xcolesearch')
let buf = RunVimInTerminal('Xcolesearch', {})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
" Jump to something that is beyond the bottom of the window,
" so there's a scroll down.
call term_sendkeys(buf, ":so %\<CR>")
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, "/expr\<CR>")
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
" Are the concealed parts of the current line really hidden?
let cursor_row = term_scrape(buf, '.')->map({_, e -> e.chars})->join('')
@@ -335,7 +335,7 @@ func Test_cursor_column_in_concealed_line_after_leftcol_change()
" Horizontal scroll would center the cursor in the screen line, but conceal
" makes it go to screen column 1.
call term_sendkeys(buf, "$")
- call term_wait(buf)
+ call TermWait(buf)
" Are the concealed parts of the current line really hidden?
call WaitForAssert({-> assert_equal('c', term_getline(buf, '.'))})
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index 23e7735cb0..90d0d201f7 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -114,7 +114,7 @@ func Test_mode_message_at_leaving_insert_by_ctrl_c()
let rows = 10
let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
call assert_equal('run', job_status(term_getjob(buf)))
call term_sendkeys(buf, "i")
@@ -143,7 +143,7 @@ func Test_mode_message_at_leaving_insert_with_esc_mapped()
let rows = 10
let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
- call term_wait(buf, 200)
+ call WaitForAssert({-> assert_match('0,0-1\s*All$', term_getline(buf, rows - 1))})
call assert_equal('run', job_status(term_getjob(buf)))
call term_sendkeys(buf, "i")
diff --git a/src/testdir/test_number.vim b/src/testdir/test_number.vim
index fef187bf90..17a1e35117 100644
--- a/src/testdir/test_number.vim
+++ b/src/testdir/test_number.vim
@@ -280,7 +280,7 @@ func Test_relativenumber_colors()
" Check that the balloon shows up after a mouse move
let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
" Default colors
call VerifyScreenDump(buf, 'Test_relnr_colors_1', {})
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 4ca35b2568..e96d5fda50 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -683,11 +683,11 @@ func Test_popup_and_window_resize()
call term_sendkeys(buf, "Gi\<c-x>")
call term_sendkeys(buf, "\<c-v>")
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
" popup first entry "!" must be at the top
call WaitForAssert({-> assert_match('^!\s*$', term_getline(buf, 1))})
exe 'resize +' . (h - 1)
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
redraw!
" popup shifted down, first line is now empty
call WaitForAssert({-> assert_equal('', term_getline(buf, 1))})
@@ -750,11 +750,11 @@ func Test_popup_and_previewwindow_dump()
let buf = RunVimInTerminal('-S Xscript', {})
" wait for the script to finish
- call term_wait(buf)
+ call TermWait(buf)
" Test that popup and previewwindow do not overlap.
call term_sendkeys(buf, "o")
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, "\<C-X>\<C-N>")
call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {})
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 478e9d49e9..03285f935c 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -65,9 +65,9 @@ func Test_simple_popup()
" clear all popups after moving the cursor a bit, so that ruler is updated
call term_sendkeys(buf, "axxx\<Esc>")
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, "0")
- call term_wait(buf)
+ call TermWait(buf)
call term_sendkeys(buf, ":call popup_clear()\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_08', {})
@@ -1389,7 +1389,7 @@ func Test_popup_beval()
END
call writefile(lines, 'XtestPopupBeval')
let buf = RunVimInTerminal('-S XtestPopupBeval', #{rows: 10})
- call term_wait(buf, 100)
+ call TermWait(buf, 50)
call term_sendkeys(buf, 'j')
call term_sendkeys(buf, ":call Hover()\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_beval_1', {})
@@ -2958,7 +2958,7 @@ func Test_popupmenu_info_border()
call writefile(lines, 'XtestInfoPopup')
let buf = RunVimInTerminal('-S XtestInfoPopup', #{rows: 14})
- call term_wait(buf, 50)
+ call TermWait(buf, 25)
call term_sendkeys(buf, "A\<C-X>\<C-U>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_1', {})
@@ -3006,7 +3006,7 @@ func Test_popupmenu_info_noborder()
call writefile(lines, 'XtestInfoPopupNb')
let buf = RunVimInTerminal('-S XtestInfoPopupNb', #{rows: 14})
- call term_wait(buf, 50)
+ call TermWait(buf, 25)
call term_sendkeys(buf, "A\<C-X>\<C-U>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_nb_1', {})
@@ -3024,7 +3024,7 @@ func Test_popupmenu_info_align_menu()
call writefile(lines, 'XtestInfoPopupNb')
let buf = RunVimInTerminal('-S XtestInfoPopupNb', #{rows: 14})
- call term_wait(buf, 50)
+ call TermWait(buf, 25)
call term_sendkeys(buf, "A\<C-X>\<C-U>")
call term_sendkeys(buf, "\<C-N>")
@@ -3055,7 +3055,7 @@ func Test_popupmenu_info_hidden()
call writefile(lines, 'XtestInfoPopupHidden')
let buf = RunVimInTerminal('-S XtestInfoPopupHidden', #{rows: 14})
- call term_wait(buf, 50)
+ call TermWait(buf, 25)
call term_sendkeys(buf, "A\<C-X>\<C-U>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_hidden_1', {})
@@ -3113,7 +3113,7 @@ func Test_popupmenu_info_too_wide()
call writefile(lines, 'XtestInfoPopupWide')
let buf = RunVimInTerminal('-S XtestInfoPopupWide', #{rows: 8})
- call term_wait(buf, 50)
+ call TermWait(buf, 25)
call term_sendkeys(buf, "Ascr\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_popupwin_infopopup_wide_1', {})
diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim
index 5f3f7cb726..7018ea5fbc 100644
--- a/src/testdir/test_profile.vim
+++ b/src/testdir/test_profile.vim
@@ -541,7 +541,7 @@ func Test_profile_typed_func()
\ .. "endfunc\<CR>")
call term_sendkeys(buf, ":profile func DoSomething\<CR>")
call term_sendkeys(buf, ":call DoSomething()\<CR>")
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
call StopVimInTerminal(buf)
let lines = readfile('XprofileTypedFunc')
call assert_equal("FUNCTION DoSomething()", lines[0])
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index b17e450842..fcbadfd204 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -672,7 +672,7 @@ func Test_search_cmdline8()
call term_sendkeys(buf, "/vim\<cr>")
call term_sendkeys(buf, "/b\<esc>")
call term_sendkeys(buf, "gg0")
- call term_wait(buf, 500)
+ call TermWait(buf, 250)
let screen_line = term_scrape(buf, 1)
let [a0,a1,a2,a3] = [screen_line[3].attr, screen_line[4].attr,
\ s