• R/O
  • SSH

vim: 提交

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

修訂c087099e91635025293d85b6e1f04ce569f65951 (tree)
時間2020-04-09 05:00:05
作者Bram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.0533: tests using term_wait() can still be flaky

Commit: https://github.com/vim/vim/commit/6a2c5a7dd5c9215cc030d5ea6e4616d782c091dd
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 8 21:50:25 2020 +0200

patch 8.2.0533: tests using term_wait() can still be flaky
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.

Change Summary

差異

diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/term_util.vim
--- a/src/testdir/term_util.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/term_util.vim Wed Apr 08 22:00:05 2020 +0200
@@ -24,6 +24,21 @@
2424 call WaitFor({-> job_status(job) == "dead"})
2525 endfunc
2626
27+" Wrapper around term_wait() to allow more time for re-runs of flaky tests
28+" The second argument is the minimum time to wait in msec, 10 if omitted.
29+func TermWait(buf, ...)
30+ let wait_time = a:0 ? a:1 : 10
31+ if g:run_nr == 2
32+ let wait_time *= 4
33+ elseif g:run_nr > 2
34+ let wait_time *= 10
35+ endif
36+ call term_wait(a:buf, wait_time)
37+
38+ " In case it wasn't set yet.
39+ let g:test_is_flaky = 1
40+endfunc
41+
2742 " Run Vim with "arguments" in a new terminal window.
2843 " By default uses a size of 20 lines and 75 columns.
2944 " Returns the buffer number of the terminal.
@@ -82,7 +97,7 @@
8297 let cols = term_getsize(buf)[1]
8398 endif
8499
85- call term_wait(buf)
100+ call TermWait(buf)
86101
87102 " Wait for "All" or "Top" of the ruler to be shown in the last line or in
88103 " the status line of the last window. This can be quite slow (e.g. when
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_arglist.vim
--- a/src/testdir/test_arglist.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_arglist.vim Wed Apr 08 22:00:05 2020 +0200
@@ -518,7 +518,7 @@
518518 call term_sendkeys(buf, ":set nomore\n")
519519 call term_sendkeys(buf, ":args a b c\n")
520520 call term_sendkeys(buf, ":quit\n")
521- call term_wait(buf)
521+ call TermWait(buf)
522522 call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))})
523523 call StopVimInTerminal(buf)
524524
@@ -527,16 +527,16 @@
527527 call term_sendkeys(buf, ":set nomore\n")
528528 call term_sendkeys(buf, ":args a b c\n")
529529 call term_sendkeys(buf, ":confirm quit\n")
530- call term_wait(buf)
530+ call TermWait(buf)
531531 call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$',
532532 \ term_getline(buf, 6))})
533533 call term_sendkeys(buf, "N")
534- call term_wait(buf)
534+ call TermWait(buf)
535535 call term_sendkeys(buf, ":confirm quit\n")
536536 call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$',
537537 \ term_getline(buf, 6))})
538538 call term_sendkeys(buf, "Y")
539- call term_wait(buf)
539+ call TermWait(buf)
540540 call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))})
541541 only!
542542 " When this test fails, swap files are left behind which breaks subsequent
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_autocmd.vim
--- a/src/testdir/test_autocmd.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_autocmd.vim Wed Apr 08 22:00:05 2020 +0200
@@ -1761,9 +1761,9 @@
17611761 augroup END
17621762 let s:li = []
17631763 let s:dir_this = getcwd()
1764- let s:dir_foo = s:dir_this . '/foo'
1764+ let s:dir_foo = s:dir_this . '/Xfoo'
17651765 call mkdir(s:dir_foo)
1766- let s:dir_bar = s:dir_this . '/bar'
1766+ let s:dir_bar = s:dir_this . '/Xbar'
17671767 call mkdir(s:dir_bar)
17681768 endfunc
17691769
@@ -2291,9 +2291,9 @@
22912291 call WaitForAssert({-> assert_match('^xxx', term_getline(buf, 6))}, 1000)
22922292
22932293 call term_sendkeys(buf, ":let g:again = ''\<CR>:call CallTimer()\<CR>")
2294- call term_wait(buf, 100)
2294+ call TermWait(buf, 50)
22952295 call term_sendkeys(buf, ":\<CR>")
2296- call term_wait(buf, 100)
2296+ call TermWait(buf, 50)
22972297 call term_sendkeys(buf, ":echo g:again\<CR>")
22982298 call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000)
22992299
@@ -2317,7 +2317,7 @@
23172317 let buf = RunVimInTerminal('-S '.filename, #{rows: 6})
23182318
23192319 call term_sendkeys(buf, "q:")
2320- call term_wait(buf)
2320+ call TermWait(buf)
23212321 call term_sendkeys(buf, ":echo b:dummy_var\<cr>")
23222322 call WaitForAssert({-> assert_match('^This is a dummy', term_getline(buf, 6))}, 2000)
23232323 call term_sendkeys(buf, ":echo &buftype\<cr>")
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_balloon.vim
--- a/src/testdir/test_balloon.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_balloon.vim Wed Apr 08 22:00:05 2020 +0200
@@ -32,14 +32,14 @@
3232
3333 " Check that the balloon shows up after a mouse move
3434 let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50})
35- call term_wait(buf, 100)
35+ call TermWait(buf, 50)
3636 call term_sendkeys(buf, 'll')
3737 call term_sendkeys(buf, ":call Trigger()\<CR>")
3838 call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {})
3939
4040 " Make sure the balloon still shows after 'updatetime' passed and CursorHold
4141 " was triggered.
42- call term_wait(buf, 300)
42+ call TermWait(buf, 150)
4343 call VerifyScreenDump(buf, 'Test_balloon_eval_term_01a', {})
4444
4545 " clean up
@@ -57,7 +57,7 @@
5757
5858 " Check that the balloon shows up after a mouse move
5959 let buf = RunVimInTerminal('-S XTest_beval_visual', {'rows': 10, 'cols': 50})
60- call term_wait(buf, 100)
60+ call TermWait(buf, 50)
6161 call VerifyScreenDump(buf, 'Test_balloon_eval_term_02', {})
6262
6363 " clean up
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_bufline.vim
--- a/src/testdir/test_bufline.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_bufline.vim Wed Apr 08 22:00:05 2020 +0200
@@ -164,7 +164,7 @@
164164 END
165165 call writefile(lines, 'XscriptMatchCommon')
166166 let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10})
167- call term_wait(buf)
167+ call TermWait(buf)
168168 call VerifyScreenDump(buf, 'Test_appendbufline_1', {})
169169
170170 call StopVimInTerminal(buf)
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_channel.vim
--- a/src/testdir/test_channel.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_channel.vim Wed Apr 08 22:00:05 2020 +0200
@@ -1062,7 +1062,7 @@
10621062 END
10631063 call writefile(lines, 'XtestBufferScroll')
10641064 let buf = RunVimInTerminal('-S XtestBufferScroll', #{rows: 10})
1065- call term_wait(buf, 100)
1065+ call TermWait(buf, 50)
10661066 call VerifyScreenDump(buf, 'Test_job_buffer_scroll_1', {})
10671067
10681068 " clean up
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_cmdline.vim
--- a/src/testdir/test_cmdline.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_cmdline.vim Wed Apr 08 22:00:05 2020 +0200
@@ -947,7 +947,7 @@
947947 call writefile(lines, 'XTest_verbose')
948948
949949 let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12})
950- call term_wait(buf, 100)
950+ call TermWait(buf, 50)
951951 call term_sendkeys(buf, ":DoSomething\<CR>")
952952 call VerifyScreenDump(buf, 'Test_verbose_option_1', {})
953953
@@ -1024,7 +1024,7 @@
10241024 call writefile(lines, 'XTest_restore')
10251025
10261026 let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
1027- call term_wait(buf, 100)
1027+ call TermWait(buf, 50)
10281028 call term_sendkeys(buf, "q:")
10291029 call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {})
10301030
@@ -1146,7 +1146,7 @@
11461146
11471147 call writefile(lines, 'XtestCmdlineClearTabenter')
11481148 let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10})
1149- call term_wait(buf, 50)
1149+ call TermWait(buf, 25)
11501150 " in one tab make the command line higher with CTRL-W -
11511151 call term_sendkeys(buf, ":tabnew\<cr>\<C-w>-\<C-w>-gtgt")
11521152 call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {})
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_conceal.vim
--- a/src/testdir/test_conceal.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_conceal.vim Wed Apr 08 22:00:05 2020 +0200
@@ -147,7 +147,7 @@
147147 call VerifyScreenDump(buf, 'Test_conceal_resize_01', {})
148148
149149 call win_execute(buf->win_findbuf()[0], 'wincmd +')
150- call term_wait(buf)
150+ call TermWait(buf)
151151 call VerifyScreenDump(buf, 'Test_conceal_resize_02', {})
152152
153153 " clean up
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_cursorline.vim
--- a/src/testdir/test_cursorline.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_cursorline.vim Wed Apr 08 22:00:05 2020 +0200
@@ -135,41 +135,41 @@
135135 call writefile(lines, filename)
136136 " basic test
137137 let buf = RunVimInTerminal('-S '. filename, #{rows: 20})
138- call term_wait(buf)
138+ call TermWait(buf)
139139 call VerifyScreenDump(buf, 'Test_'. filename. '_1', {})
140140 call term_sendkeys(buf, "fagj")
141- call term_wait(buf)
141+ call TermWait(buf)
142142 call VerifyScreenDump(buf, 'Test_'. filename. '_2', {})
143143 call term_sendkeys(buf, "gj")
144- call term_wait(buf)
144+ call TermWait(buf)
145145 call VerifyScreenDump(buf, 'Test_'. filename. '_3', {})
146146 call term_sendkeys(buf, "gj")
147- call term_wait(buf)
147+ call TermWait(buf)
148148 call VerifyScreenDump(buf, 'Test_'. filename. '_4', {})
149149 call term_sendkeys(buf, "gj")
150- call term_wait(buf)
150+ call TermWait(buf)
151151 call VerifyScreenDump(buf, 'Test_'. filename. '_5', {})
152152 call term_sendkeys(buf, "gj")
153- call term_wait(buf)
153+ call TermWait(buf)
154154 call VerifyScreenDump(buf, 'Test_'. filename. '_6', {})
155155 " test with set list and cursorlineopt containing number
156156 call term_sendkeys(buf, "gg0")
157157 call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\<cr>")
158158 call VerifyScreenDump(buf, 'Test_'. filename. '_7', {})
159159 call term_sendkeys(buf, "fagj")
160- call term_wait(buf)
160+ call TermWait(buf)
161161 call VerifyScreenDump(buf, 'Test_'. filename. '_8', {})
162162 call term_sendkeys(buf, "gj")
163- call term_wait(buf)
163+ call TermWait(buf)
164164 call VerifyScreenDump(buf, 'Test_'. filename. '_9', {})
165165 call term_sendkeys(buf, "gj")
166- call term_wait(buf)
166+ call TermWait(buf)
167167 call VerifyScreenDump(buf, 'Test_'. filename. '_10', {})
168168 call term_sendkeys(buf, "gj")
169- call term_wait(buf)
169+ call TermWait(buf)
170170 call VerifyScreenDump(buf, 'Test_'. filename. '_11', {})
171171 call term_sendkeys(buf, "gj")
172- call term_wait(buf)
172+ call TermWait(buf)
173173 call VerifyScreenDump(buf, 'Test_'. filename. '_12', {})
174174 if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent")
175175 " test with set foldcolumn signcoloumn and breakindent
@@ -177,19 +177,19 @@
177177 call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>")
178178 call VerifyScreenDump(buf, 'Test_'. filename. '_13', {})
179179 call term_sendkeys(buf, "fagj")
180- call term_wait(buf)
180+ call TermWait(buf)
181181 call VerifyScreenDump(buf, 'Test_'. filename. '_14', {})
182182 call term_sendkeys(buf, "gj")
183- call term_wait(buf)
183+ call TermWait(buf)
184184 call VerifyScreenDump(buf, 'Test_'. filename. '_15', {})
185185 call term_sendkeys(buf, "gj")
186- call term_wait(buf)
186+ call TermWait(buf)
187187 call VerifyScreenDump(buf, 'Test_'. filename. '_16', {})
188188 call term_sendkeys(buf, "gj")
189- call term_wait(buf)
189+ call TermWait(buf)
190190 call VerifyScreenDump(buf, 'Test_'. filename. '_17', {})
191191 call term_sendkeys(buf, "gj")
192- call term_wait(buf)
192+ call TermWait(buf)
193193 call VerifyScreenDump(buf, 'Test_'. filename. '_18', {})
194194 endif
195195
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_debugger.vim
--- a/src/testdir/test_debugger.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_debugger.vim Wed Apr 08 22:00:05 2020 +0200
@@ -8,7 +8,7 @@
88 " If the expected output argument is supplied, then check for it.
99 func RunDbgCmd(buf, cmd, ...)
1010 call term_sendkeys(a:buf, a:cmd . "\r")
11- call term_wait(a:buf, 20)
11+ call TermWait(a:buf)
1212
1313 if a:0 != 0
1414 " Verify the expected output
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_diffmode.vim
--- a/src/testdir/test_diffmode.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_diffmode.vim Wed Apr 08 22:00:05 2020 +0200
@@ -801,7 +801,7 @@
801801 call term_sendkeys(a:buf, ":diffupdate!\<CR>")
802802 " trailing : for leaving the cursor on the command line
803803 call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:")
804- call term_wait(a:buf)
804+ call TermWait(a:buf)
805805 call VerifyScreenDump(a:buf, a:dumpfile, {})
806806 endfunc
807807
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_display.vim
--- a/src/testdir/test_display.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_display.vim Wed Apr 08 22:00:05 2020 +0200
@@ -174,7 +174,7 @@
174174 call writefile(lines, filename)
175175 let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50})
176176 call term_sendkeys(buf, "k")
177- call term_wait(buf)
177+ call TermWait(buf)
178178 call VerifyScreenDump(buf, 'Test_winline_rnu', {})
179179
180180 " clean up
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_functions.vim
--- a/src/testdir/test_functions.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_functions.vim Wed Apr 08 22:00:05 2020 +0200
@@ -1858,15 +1858,6 @@
18581858 func Test_state()
18591859 CheckRunVimInTerminal
18601860
1861- " In the first run try a short wait time. If the test fails retry with a
1862- " longer wait time.
1863- if g:run_nr == 1
1864- let wait_time = 50
1865- elseif g:run_nr == 2
1866- let wait_time = 200
1867- else
1868- let wait_time = 500
1869- endif
18701861 let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\<CR>"
18711862
18721863 let lines =<< trim END
@@ -1888,27 +1879,27 @@
18881879
18891880 " Using a timer callback
18901881 call term_sendkeys(buf, ":call RunTimer()\<CR>")
1891- call term_wait(buf, wait_time)
1882+ call TermWait(buf, 25)
18921883 call term_sendkeys(buf, getstate)
18931884 call WaitForAssert({-> assert_match('state: c; mode: n', term_getline(buf, 6))}, 1000)
18941885
18951886 " Halfway a mapping
18961887 call term_sendkeys(buf, ":call RunTimer()\<CR>;")
1897- call term_wait(buf, wait_time)
1888+ call TermWait(buf, 25)
18981889 call term_sendkeys(buf, ";")
18991890 call term_sendkeys(buf, getstate)
19001891 call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000)
19011892
19021893 " Insert mode completion (bit slower on Mac)
19031894 call term_sendkeys(buf, ":call RunTimer()\<CR>Got\<C-N>")
1904- call term_wait(buf, wait_time)
1895+ call TermWait(buf, 25)
19051896 call term_sendkeys(buf, "\<Esc>")
19061897 call term_sendkeys(buf, getstate)
19071898 call WaitForAssert({-> assert_match('state: aSc; mode: i', term_getline(buf, 6))}, 1000)
19081899
19091900 " Autocommand executing
19101901 call term_sendkeys(buf, ":set filetype=foobar\<CR>")
1911- call term_wait(buf, wait_time)
1902+ call TermWait(buf, 25)
19121903 call term_sendkeys(buf, getstate)
19131904 call WaitForAssert({-> assert_match('state: xS; mode: n', term_getline(buf, 6))}, 1000)
19141905
@@ -1916,7 +1907,7 @@
19161907
19171908 " messages scrolled
19181909 call term_sendkeys(buf, ":call RunTimer()\<CR>:echo \"one\\ntwo\\nthree\"\<CR>")
1919- call term_wait(buf, wait_time)
1910+ call TermWait(buf, 25)
19201911 call term_sendkeys(buf, "\<CR>")
19211912 call term_sendkeys(buf, getstate)
19221913 call WaitForAssert({-> assert_match('state: Scs; mode: r', term_getline(buf, 6))}, 1000)
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_highlight.vim
--- a/src/testdir/test_highlight.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_highlight.vim Wed Apr 08 22:00:05 2020 +0200
@@ -542,9 +542,9 @@
542542 \ 'call setline(1, ["","1","2","3",""])',
543543 \ ], 'Xtest_cursorline_yank')
544544 let buf = RunVimInTerminal('-S Xtest_cursorline_yank', {'rows': 8})
545- call term_wait(buf)
545+ call TermWait(buf)
546546 call term_sendkeys(buf, "Gy3k")
547- call term_wait(buf)
547+ call TermWait(buf)
548548 call term_sendkeys(buf, "jj")
549549
550550 call VerifyScreenDump(buf, 'Test_cursorline_yank_01', {})
@@ -582,7 +582,7 @@
582582 \ 'call setline(1, repeat(["abc"], 50))',
583583 \ ], 'Xtest_cursorline_with_visualmode')
584584 let buf = RunVimInTerminal('-S Xtest_cursorline_with_visualmode', {'rows': 12})
585- call term_wait(buf)
585+ call TermWait(buf)
586586 call term_sendkeys(buf, "V\<C-f>kkkjk")
587587
588588 call VerifyScreenDump(buf, 'Test_cursorline_with_visualmode_01', {})
@@ -610,9 +610,9 @@
610610 END
611611 call writefile(lines, 'Xtest_wincolor')
612612 let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8})
613- call term_wait(buf)
613+ call TermWait(buf)
614614 call term_sendkeys(buf, "2G5lvj")
615- call term_wait(buf)
615+ call TermWait(buf)
616616
617617 call VerifyScreenDump(buf, 'Test_wincolor_01', {})
618618
@@ -662,7 +662,7 @@
662662 call writefile(lines, 'Xtest_colorcolumn')
663663 let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10})
664664 call term_sendkeys(buf, ":\<CR>")
665- call term_wait(buf)
665+ call TermWait(buf)
666666 call VerifyScreenDump(buf, 'Test_colorcolumn_1', {})
667667
668668 " clean up
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_ins_complete.vim
--- a/src/testdir/test_ins_complete.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_ins_complete.vim Wed Apr 08 22:00:05 2020 +0200
@@ -402,7 +402,7 @@
402402
403403 call writefile(lines, 'Xpumscript')
404404 let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10})
405- call term_wait(buf, 100)
405+ call TermWait(buf, 50)
406406 call term_sendkeys(buf, "a\<C-N>")
407407 call VerifyScreenDump(buf, 'Test_pum_with_folds_two_tabs', {})
408408
@@ -427,9 +427,9 @@
427427
428428 call writefile(lines, 'Xpreviewscript')
429429 let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12})
430- call term_wait(buf, 100)
430+ call TermWait(buf, 50)
431431 call term_sendkeys(buf, "Gi\<C-X>\<C-O>")
432- call term_wait(buf, 200)
432+ call TermWait(buf, 100)
433433 call term_sendkeys(buf, "\<C-N>")
434434 call VerifyScreenDump(buf, 'Test_pum_with_preview_win', {})
435435
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_mapping.vim
--- a/src/testdir/test_mapping.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_mapping.vim Wed Apr 08 22:00:05 2020 +0200
@@ -430,9 +430,9 @@
430430
431431 " GC must not run during map-expr processing, which can make Vim crash.
432432 call term_sendkeys(buf, '!')
433- call term_wait(buf, 100)
433+ call TermWait(buf, 50)
434434 call term_sendkeys(buf, "\<CR>")
435- call term_wait(buf, 100)
435+ call TermWait(buf, 50)
436436 call assert_equal('run', job_status(job))
437437
438438 call term_sendkeys(buf, ":qall!\<CR>")
@@ -510,7 +510,7 @@
510510 END
511511 call writefile(lines, 'XtestExprMap')
512512 let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
513- call term_wait(buf)
513+ call TermWait(buf)
514514 call term_sendkeys(buf, "\<C-B>")
515515 call VerifyScreenDump(buf, 'Test_map_expr_1', {})
516516
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_match.vim
--- a/src/testdir/test_match.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_match.vim Wed Apr 08 22:00:05 2020 +0200
@@ -289,7 +289,7 @@
289289 END
290290 call writefile(lines, 'XscriptMatchCommon')
291291 let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12})
292- call term_wait(buf)
292+ call TermWait(buf)
293293 return buf
294294 endfunc
295295
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_matchadd_conceal.vim
--- a/src/testdir/test_matchadd_conceal.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_matchadd_conceal.vim Wed Apr 08 22:00:05 2020 +0200
@@ -298,14 +298,14 @@
298298 END
299299 call writefile(lines, 'Xcolesearch')
300300 let buf = RunVimInTerminal('Xcolesearch', {})
301- call term_wait(buf, 100)
301+ call TermWait(buf, 50)
302302
303303 " Jump to something that is beyond the bottom of the window,
304304 " so there's a scroll down.
305305 call term_sendkeys(buf, ":so %\<CR>")
306- call term_wait(buf, 100)
306+ call TermWait(buf, 50)
307307 call term_sendkeys(buf, "/expr\<CR>")
308- call term_wait(buf, 100)
308+ call TermWait(buf, 50)
309309
310310 " Are the concealed parts of the current line really hidden?
311311 let cursor_row = term_scrape(buf, '.')->map({_, e -> e.chars})->join('')
@@ -335,7 +335,7 @@
335335 " Horizontal scroll would center the cursor in the screen line, but conceal
336336 " makes it go to screen column 1.
337337 call term_sendkeys(buf, "$")
338- call term_wait(buf)
338+ call TermWait(buf)
339339
340340 " Are the concealed parts of the current line really hidden?
341341 call WaitForAssert({-> assert_equal('c', term_getline(buf, '.'))})
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_messages.vim
--- a/src/testdir/test_messages.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_messages.vim Wed Apr 08 22:00:05 2020 +0200
@@ -114,7 +114,7 @@
114114
115115 let rows = 10
116116 let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
117- call term_wait(buf, 200)
117+ call TermWait(buf, 100)
118118 call assert_equal('run', job_status(term_getjob(buf)))
119119
120120 call term_sendkeys(buf, "i")
@@ -143,7 +143,7 @@
143143
144144 let rows = 10
145145 let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
146- call term_wait(buf, 200)
146+ call WaitForAssert({-> assert_match('0,0-1\s*All$', term_getline(buf, rows - 1))})
147147 call assert_equal('run', job_status(term_getjob(buf)))
148148
149149 call term_sendkeys(buf, "i")
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_number.vim
--- a/src/testdir/test_number.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_number.vim Wed Apr 08 22:00:05 2020 +0200
@@ -280,7 +280,7 @@
280280
281281 " Check that the balloon shows up after a mouse move
282282 let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50})
283- call term_wait(buf, 100)
283+ call TermWait(buf, 50)
284284 " Default colors
285285 call VerifyScreenDump(buf, 'Test_relnr_colors_1', {})
286286
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_popup.vim
--- a/src/testdir/test_popup.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_popup.vim Wed Apr 08 22:00:05 2020 +0200
@@ -683,11 +683,11 @@
683683
684684 call term_sendkeys(buf, "Gi\<c-x>")
685685 call term_sendkeys(buf, "\<c-v>")
686- call term_wait(buf, 100)
686+ call TermWait(buf, 50)
687687 " popup first entry "!" must be at the top
688688 call WaitForAssert({-> assert_match('^!\s*$', term_getline(buf, 1))})
689689 exe 'resize +' . (h - 1)
690- call term_wait(buf, 100)
690+ call TermWait(buf, 50)
691691 redraw!
692692 " popup shifted down, first line is now empty
693693 call WaitForAssert({-> assert_equal('', term_getline(buf, 1))})
@@ -750,11 +750,11 @@
750750 let buf = RunVimInTerminal('-S Xscript', {})
751751
752752 " wait for the script to finish
753- call term_wait(buf)
753+ call TermWait(buf)
754754
755755 " Test that popup and previewwindow do not overlap.
756756 call term_sendkeys(buf, "o")
757- call term_wait(buf, 100)
757+ call TermWait(buf, 50)
758758 call term_sendkeys(buf, "\<C-X>\<C-N>")
759759 call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {})
760760
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_popupwin.vim
--- a/src/testdir/test_popupwin.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_popupwin.vim Wed Apr 08 22:00:05 2020 +0200
@@ -65,9 +65,9 @@
6565
6666 " clear all popups after moving the cursor a bit, so that ruler is updated
6767 call term_sendkeys(buf, "axxx\<Esc>")
68- call term_wait(buf)
68+ call TermWait(buf)
6969 call term_sendkeys(buf, "0")
70- call term_wait(buf)
70+ call TermWait(buf)
7171 call term_sendkeys(buf, ":call popup_clear()\<CR>")
7272 call VerifyScreenDump(buf, 'Test_popupwin_08', {})
7373
@@ -1389,7 +1389,7 @@
13891389 END
13901390 call writefile(lines, 'XtestPopupBeval')
13911391 let buf = RunVimInTerminal('-S XtestPopupBeval', #{rows: 10})
1392- call term_wait(buf, 100)
1392+ call TermWait(buf, 50)
13931393 call term_sendkeys(buf, 'j')
13941394 call term_sendkeys(buf, ":call Hover()\<CR>")
13951395 call VerifyScreenDump(buf, 'Test_popupwin_beval_1', {})
@@ -2958,7 +2958,7 @@
29582958 call writefile(lines, 'XtestInfoPopup')
29592959
29602960 let buf = RunVimInTerminal('-S XtestInfoPopup', #{rows: 14})
2961- call term_wait(buf, 50)
2961+ call TermWait(buf, 25)
29622962
29632963 call term_sendkeys(buf, "A\<C-X>\<C-U>")
29642964 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_1', {})
@@ -3006,7 +3006,7 @@
30063006 call writefile(lines, 'XtestInfoPopupNb')
30073007
30083008 let buf = RunVimInTerminal('-S XtestInfoPopupNb', #{rows: 14})
3009- call term_wait(buf, 50)
3009+ call TermWait(buf, 25)
30103010
30113011 call term_sendkeys(buf, "A\<C-X>\<C-U>")
30123012 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_nb_1', {})
@@ -3024,7 +3024,7 @@
30243024 call writefile(lines, 'XtestInfoPopupNb')
30253025
30263026 let buf = RunVimInTerminal('-S XtestInfoPopupNb', #{rows: 14})
3027- call term_wait(buf, 50)
3027+ call TermWait(buf, 25)
30283028
30293029 call term_sendkeys(buf, "A\<C-X>\<C-U>")
30303030 call term_sendkeys(buf, "\<C-N>")
@@ -3055,7 +3055,7 @@
30553055 call writefile(lines, 'XtestInfoPopupHidden')
30563056
30573057 let buf = RunVimInTerminal('-S XtestInfoPopupHidden', #{rows: 14})
3058- call term_wait(buf, 50)
3058+ call TermWait(buf, 25)
30593059
30603060 call term_sendkeys(buf, "A\<C-X>\<C-U>")
30613061 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_hidden_1', {})
@@ -3113,7 +3113,7 @@
31133113
31143114 call writefile(lines, 'XtestInfoPopupWide')
31153115 let buf = RunVimInTerminal('-S XtestInfoPopupWide', #{rows: 8})
3116- call term_wait(buf, 50)
3116+ call TermWait(buf, 25)
31173117
31183118 call term_sendkeys(buf, "Ascr\<C-X>\<C-O>")
31193119 call VerifyScreenDump(buf, 'Test_popupwin_infopopup_wide_1', {})
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_profile.vim
--- a/src/testdir/test_profile.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_profile.vim Wed Apr 08 22:00:05 2020 +0200
@@ -541,7 +541,7 @@
541541 \ .. "endfunc\<CR>")
542542 call term_sendkeys(buf, ":profile func DoSomething\<CR>")
543543 call term_sendkeys(buf, ":call DoSomething()\<CR>")
544- call term_wait(buf, 200)
544+ call TermWait(buf, 100)
545545 call StopVimInTerminal(buf)
546546 let lines = readfile('XprofileTypedFunc')
547547 call assert_equal("FUNCTION DoSomething()", lines[0])
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_search.vim
--- a/src/testdir/test_search.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_search.vim Wed Apr 08 22:00:05 2020 +0200
@@ -672,7 +672,7 @@
672672 call term_sendkeys(buf, "/vim\<cr>")
673673 call term_sendkeys(buf, "/b\<esc>")
674674 call term_sendkeys(buf, "gg0")
675- call term_wait(buf, 500)
675+ call TermWait(buf, 250)
676676 let screen_line = term_scrape(buf, 1)
677677 let [a0,a1,a2,a3] = [screen_line[3].attr, screen_line[4].attr,
678678 \ screen_line[18].attr, screen_line[19].attr]
@@ -792,12 +792,12 @@
792792
793793 call WaitForAssert({-> assert_equal(lines, [term_getline(buf, 1), term_getline(buf, 2)])})
794794 " wait for vim to complete initialization
795- call term_wait(buf)
795+ call TermWait(buf)
796796
797797 " Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight
798798 call term_sendkeys(buf, ":set incsearch hlsearch\<cr>")
799799 call term_sendkeys(buf, '/b')
800- call term_wait(buf, 200)
800+ call TermWait(buf, 100)
801801 let screen_line1 = term_scrape(buf, 1)
802802 call assert_true(len(screen_line1) > 2)
803803 " a0: attr_normal
@@ -813,7 +813,7 @@
813813
814814 " Test incremental highlight search
815815 call term_sendkeys(buf, "/vim")
816- call term_wait(buf, 200)
816+ call TermWait(buf, 100)
817817 " Buffer:
818818 " abb vim vim vi
819819 " vimvivim
@@ -825,7 +825,7 @@
825825
826826 " Test <C-g>
827827 call term_sendkeys(buf, "\<C-g>\<C-g>")
828- call term_wait(buf, 200)
828+ call TermWait(buf, 100)
829829 let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0]
830830 let attr_line2 = [a1,a1,a1,a0,a0,a2,a2,a2]
831831 call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
@@ -833,7 +833,7 @@
833833
834834 " Test <C-t>
835835 call term_sendkeys(buf, "\<C-t>")
836- call term_wait(buf, 200)
836+ call TermWait(buf, 100)
837837 let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a1,a1,a1,a0,a0,a0]
838838 let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2]
839839 call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
@@ -841,7 +841,7 @@
841841
842842 " Type Enter and a1(incsearch highlight) should become a2(hlsearch highlight)
843843 call term_sendkeys(buf, "\<cr>")
844- call term_wait(buf, 200)
844+ call TermWait(buf, 100)
845845 let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0]
846846 let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2]
847847 call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
@@ -851,7 +851,7 @@
851851 call term_sendkeys(buf, ":1\<cr>")
852852 call term_sendkeys(buf, ":set nohlsearch\<cr>")
853853 call term_sendkeys(buf, "/vim")
854- call term_wait(buf, 200)
854+ call TermWait(buf, 100)
855855 let attr_line1 = [a0,a0,a0,a0,a1,a1,a1,a0,a0,a0,a0,a0,a0,a0]
856856 let attr_line2 = [a0,a0,a0,a0,a0,a0,a0,a0]
857857 call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_search_stat.vim
--- a/src/testdir/test_search_stat.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_search_stat.vim Wed Apr 08 22:00:05 2020 +0200
@@ -202,12 +202,12 @@
202202 END
203203 call writefile(lines, 'Xsearchstat')
204204 let buf = RunVimInTerminal('-S Xsearchstat', #{rows: 10})
205- call term_wait(buf)
205+ call TermWait(buf)
206206 call VerifyScreenDump(buf, 'Test_searchstat_1', {})
207207
208208 call term_sendkeys(buf, ":nnoremap <silent> n n\<cr>")
209209 call term_sendkeys(buf, "gg0n")
210- call term_wait(buf)
210+ call TermWait(buf)
211211 call VerifyScreenDump(buf, 'Test_searchstat_2', {})
212212
213213 call StopVimInTerminal(buf)
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_startup.vim
--- a/src/testdir/test_startup.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_startup.vim Wed Apr 08 22:00:05 2020 +0200
@@ -795,9 +795,9 @@
795795 let cmd = GetVimCommandCleanTerm() . ' -u Xvimrc_missing -S Xafter'
796796 let buf = term_start(cmd, {'term_rows' : 10})
797797 call WaitForAssert({-> assert_equal("running", term_getstatus(buf))})
798- call term_wait(buf)
798+ call TermWait(buf)
799799 call term_sendkeys(buf, "\n:")
800- call term_wait(buf)
800+ call TermWait(buf)
801801 call WaitForAssert({-> assert_match(':', term_getline(buf, 10))})
802802 call StopVimInTerminal(buf)
803803 call assert_equal([], readfile('Xtestout'))
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_startup_utf8.vim
--- a/src/testdir/test_startup_utf8.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_startup_utf8.vim Wed Apr 08 22:00:05 2020 +0200
@@ -74,7 +74,7 @@
7474 \ 'redraw',
7575 \ ], 'Xscript')
7676 let buf = RunVimInTerminal('-S Xscript', {})
77- call term_wait(buf)
77+ call TermWait(buf)
7878 call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>")
7979 call WaitForAssert({-> assert_match('single', term_getline(buf, 1))})
8080
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_statusline.vim
--- a/src/testdir/test_statusline.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_statusline.vim Wed Apr 08 22:00:05 2020 +0200
@@ -406,7 +406,7 @@
406406 call writefile(lines, 'XTest_statusline')
407407
408408 let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 10, 'cols': 50})
409- call term_wait(buf, 100)
409+ call TermWait(buf, 50)
410410 call VerifyScreenDump(buf, 'Test_statusline_1', {})
411411
412412 " clean up
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_suspend.vim
--- a/src/testdir/test_suspend.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_suspend.vim Wed Apr 08 22:00:05 2020 +0200
@@ -53,7 +53,7 @@
5353
5454 " Quit gracefully to dump coverage information.
5555 call term_sendkeys(buf, ":qall!\<CR>")
56- call term_wait(buf)
56+ call TermWait(buf)
5757 " Wait until Vim actually exited and shell shows a prompt
5858 call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
5959 call StopShellInTerminal(buf)
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_swap.vim
--- a/src/testdir/test_swap.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_swap.vim Wed Apr 08 22:00:05 2020 +0200
@@ -363,14 +363,14 @@
363363 call term_sendkeys(buf, ":set nomore\n")
364364 call term_sendkeys(buf, ":set noruler\n")
365365 call term_sendkeys(buf, ":split Xfile1\n")
366- call term_wait(buf)
366+ call TermWait(buf)
367367 call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))})
368368 call term_sendkeys(buf, "q")
369- call term_wait(buf)
369+ call TermWait(buf)
370370 call term_sendkeys(buf, ":\<CR>")
371371 call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))})
372372 call term_sendkeys(buf, ":echomsg winnr('$')\<CR>")
373- call term_wait(buf)
373+ call TermWait(buf)
374374 call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))})
375375 call StopVimInTerminal(buf)
376376 %bwipe!
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_tagjump.vim
--- a/src/testdir/test_tagjump.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_tagjump.vim Wed Apr 08 22:00:05 2020 +0200
@@ -544,7 +544,7 @@
544544 call writefile(lines, 'XTest_tselect')
545545 let buf = RunVimInTerminal('-S XTest_tselect', {'rows': 10, 'cols': 50})
546546
547- call term_wait(buf, 100)
547+ call TermWait(buf, 50)
548548 call term_sendkeys(buf, ":tselect main\<CR>2\<CR>")
549549 call VerifyScreenDump(buf, 'Test_tselect_1', {})
550550
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_terminal.vim
--- a/src/testdir/test_terminal.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_terminal.vim Wed Apr 08 22:00:05 2020 +0200
@@ -44,7 +44,7 @@
4444 call assert_notmatch('%[^\n]*running]', execute('ls ?'))
4545
4646 call StopShellInTerminal(buf)
47- call term_wait(buf)
47+ call TermWait(buf)
4848 call assert_equal('n', mode())
4949 call assert_match('%aF[^\n]*finished]', execute('ls'))
5050 call assert_match('%aF[^\n]*finished]', execute('ls F'))
@@ -79,7 +79,7 @@
7979 func Test_terminal_make_change()
8080 let buf = Run_shell_in_terminal({})
8181 call StopShellInTerminal(buf)
82- call term_wait(buf)
82+ call TermWait(buf)
8383
8484 setlocal modifiable
8585 exe "normal Axxx\<Esc>"
@@ -117,10 +117,10 @@
117117
118118 func Test_terminal_split_quit()
119119 let buf = Run_shell_in_terminal({})
120- call term_wait(buf)
120+ call TermWait(buf)
121121 split
122122 quit!
123- call term_wait(buf)
123+ call TermWait(buf)
124124 sleep 50m
125125 call assert_equal('run', job_status(g:job))
126126
@@ -225,7 +225,7 @@
225225 " Nothing happens with invalid buffer number
226226 call term_wait(1234)
227227
228- call term_wait(buf)
228+ call TermWait(buf)
229229 " On MS-Windows we first get a startup message of two lines, wait for the
230230 " "cls" to happen, after that we have one line with three characters.
231231 call WaitForAssert({-> assert_equal(3, len(term_scrape(buf, 1)))})
@@ -234,7 +234,7 @@
234234 " Must still work after the job ended.
235235 let job = term_getjob(buf)
236236 call WaitForAssert({-> assert_equal("dead", job_status(job))})
237- call term_wait(buf)
237+ call TermWait(buf)
238238 call Check_123(buf)
239239
240240 exe buf . 'bwipe'
@@ -270,7 +270,7 @@
270270
271271 let job = term_getjob(buf)
272272 call WaitForAssert({-> assert_equal("dead", job_status(job))})
273- call term_wait(buf)
273+ call TermWait(buf)
274274
275275 exe buf . 'bwipe'
276276 call delete('Xtext')
@@ -287,7 +287,7 @@
287287
288288 let job = term_getjob(buf)
289289 call WaitForAssert({-> assert_equal("dead", job_status(job))})
290- call term_wait(buf)
290+ call TermWait(buf)
291291
292292 " wait until the scrolling stops
293293 while 1
@@ -325,7 +325,7 @@
325325 call assert_inrange(91, 100, lines)
326326
327327 call StopShellInTerminal(buf)
328- call term_wait(buf)
328+ call TermWait(buf)
329329 exe buf . 'bwipe'
330330 set termwinscroll&
331331 call delete('Xtext')
@@ -359,10 +359,10 @@
359359
360360 " stop "tail -f"
361361 call term_sendkeys(buf, "\<C-C>")
362- call term_wait(buf, 50)
362+ call TermWait(buf, 25)
363363 " stop shell
364364 call term_sendkeys(buf, "exit\<CR>")
365- call term_wait(buf, 100)
365+ call TermWait(buf, 50)
366366 " close terminal window
367367 let tsk_ret = term_sendkeys(buf, ":q\<CR>")
368368
@@ -622,7 +622,7 @@
622622 else
623623 call term_sendkeys(buf, "echo $" . a:name . "\r")
624624 endif
625- call term_wait(buf)
625+ call TermWait(buf)
626626 call StopShellInTerminal(buf)
627627 call WaitForAssert({-> assert_equal(a:value, getline(2))})
628628
@@ -639,7 +639,7 @@
639639 else
640640 call term_sendkeys(buf, "echo $TESTENV\r")
641641 endif
642- eval buf->term_wait()
642+ eval buf->TermWait()
643643 call StopShellInTerminal(buf)
644644 call WaitForAssert({-> assert_equal('correct', getline(2))})
645645
@@ -688,7 +688,7 @@
688688
689689 let g:job = term_getjob(buf)
690690 call StopShellInTerminal(buf)
691- call term_wait(buf)
691+ call TermWait(buf)
692692 unlet g:job
693693 bwipe
694694 endfunc
@@ -813,7 +813,7 @@
813813 func Test_terminal_redir_file()
814814 let cmd = Get_cat_123_cmd()
815815 let buf = term_start(cmd, {'out_io': 'file', 'out_name': 'Xfile'})
816- call term_wait(buf)
816+ call TermWait(buf)
817817 " ConPTY may precede escape sequence. There are things that are not so.
818818 if !has('conpty')
819819 call WaitForAssert({-> assert_notequal(0, len(readfile("Xfile")))})
@@ -827,7 +827,7 @@
827827 if has('unix')
828828 call writefile(['one line'], 'Xfile')
829829 let buf = term_start('cat', {'in_io': 'file', 'in_name': 'Xfile'})
830- call term_wait(buf)
830+ call TermWait(buf)
831831 call WaitForAssert({-> assert_equal('one line', term_getline(buf, 1))})
832832 let g:job = term_getjob(buf)
833833 call WaitForAssert({-> assert_equal('dead', job_status(g:job))})
@@ -860,7 +860,7 @@
860860
861861 call term_sendkeys(buf, "\r")
862862 call StopShellInTerminal(buf)
863- call term_wait(buf)
863+ call TermWait(buf)
864864
865865 tunmap 123
866866 tunmap 456
@@ -878,7 +878,7 @@
878878 let buf = Run_shell_in_terminal({})
879879 wall
880880 call StopShellInTerminal(buf)
881- call term_wait(buf)
881+ call TermWait(buf)
882882 exe buf . 'bwipe'
883883 unlet g:job
884884 endfunc
@@ -887,7 +887,7 @@
887887 let buf = Run_shell_in_terminal({})
888888 call assert_fails('wqall', 'E948')
889889 call StopShellInTerminal(buf)
890- call term_wait(buf)
890+ call TermWait(buf)
891891 exe buf . 'bwipe'
892892 unlet g:job
893893 endfunc
@@ -908,7 +908,7 @@
908908 enew
909909 let buf = term_start(cmd, {'curwin': bufnr('')})
910910 let g:job = term_getjob(buf)
911- call term_wait(buf, 50)
911+ call TermWait(buf, 25)
912912
913913 if has('win32')
914914 call assert_equal('cmd', job_info(g:job).cmd[0])
@@ -919,7 +919,7 @@
919919 " ascii + composing
920920 let txt = "a\u0308bc"
921921 call term_sendkeys(buf, "echo " . txt . "\r")
922- call term_wait(buf, 50)
922+ call TermWait(buf, 25)
923923 call assert_match("echo " . txt, term_getline(buf, lnum[0]))
924924 call assert_equal(txt, term_getline(buf, lnum[0] + 1))
925925 let l = term_scrape(buf, lnum[0] + 1)
@@ -930,7 +930,7 @@
930930 " multibyte + composing
931931 let txt = "\u304b\u3099\u304e\u304f\u3099\u3052\u3053\u3099"
932932 call term_sendkeys(buf, "echo " . txt . "\r")
933- call term_wait(buf, 50)
933+ call TermWait(buf, 25)
934934 call assert_match("echo " . txt, term_getline(buf, lnum[1]))
935935 call assert_equal(txt, term_getline(buf, lnum[1] + 1))
936936 let l = term_scrape(buf, lnum[1] + 1)
@@ -943,7 +943,7 @@
943943 " \u00a0 + composing
944944 let txt = "abc\u00a0\u0308"
945945 call term_sendkeys(buf, "echo " . txt . "\r")
946- call term_wait(buf, 50)
946+ call TermWait(buf, 25)
947947 call assert_match("echo " . txt, term_getline(buf, lnum[2]))
948948 call assert_equal(txt, term_getline(buf, lnum[2] + 1))
949949 let l = term_scrape(buf, lnum[2] + 1)
@@ -1587,7 +1587,7 @@
15871587 let buf = Run_shell_in_terminal({})
15881588 call assert_equal(colors, term_getansicolors(buf))
15891589 call StopShellInTerminal(buf)
1590- call term_wait(buf)
1590+ call TermWait(buf)
15911591
15921592 exe buf . 'bwipe'
15931593 endfunc
@@ -1612,7 +1612,7 @@
16121612 let buf = Run_shell_in_terminal({})
16131613 call assert_equal(g:terminal_ansi_colors, term_getansicolors(buf))
16141614 call StopShellInTerminal(buf)
1615- call term_wait(buf)
1615+ call TermWait(buf)
16161616
16171617 exe buf . 'bwipe'
16181618 unlet g:terminal_ansi_colors
@@ -1646,7 +1646,7 @@
16461646 call assert_fails('call term_setansicolors(buf, colors)', 'E474:')
16471647
16481648 call StopShellInTerminal(buf)
1649- call term_wait(buf)
1649+ call TermWait(buf)
16501650 exe buf . 'bwipe'
16511651 endfunc
16521652
@@ -1742,7 +1742,7 @@
17421742 let win = bufwinid(buf)
17431743 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
17441744 call StopShellInTerminal(buf)
1745- call term_wait(buf)
1745+ call TermWait(buf)
17461746 exe buf . 'bwipe'
17471747
17481748 set termwinsize=7x0
@@ -1750,7 +1750,7 @@
17501750 let win = bufwinid(buf)
17511751 call assert_equal([7, winwidth(win)], term_getsize(buf))
17521752 call StopShellInTerminal(buf)
1753- call term_wait(buf)
1753+ call TermWait(buf)
17541754 exe buf . 'bwipe'
17551755
17561756 set termwinsize=0x33
@@ -1758,7 +1758,7 @@
17581758 let win = bufwinid(buf)
17591759 call assert_equal([winheight(win), 33], term_getsize(buf))
17601760 call StopShellInTerminal(buf)
1761- call term_wait(buf)
1761+ call TermWait(buf)
17621762 exe buf . 'bwipe'
17631763
17641764 set termwinsize=
@@ -1788,7 +1788,7 @@
17881788 call assert_equal(30, winwidth(win))
17891789
17901790 call StopShellInTerminal(buf)
1791- call term_wait(buf)
1791+ call TermWait(buf)
17921792 exe buf . 'bwipe'
17931793
17941794 set termwinsize=0*0
@@ -1796,7 +1796,7 @@
17961796 let win = bufwinid(buf)
17971797 call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
17981798 call StopShellInTerminal(buf)
1799- call term_wait(buf)
1799+ call TermWait(buf)
18001800 exe buf . 'bwipe'
18011801
18021802 set termwinsize=
@@ -1938,7 +1938,7 @@
19381938 call assert_equal(1, winnr('$'))
19391939 let buf = Run_shell_in_terminal({'term_finish': 'close'})
19401940 call StopShellInTerminal(buf)
1941- call term_wait(buf)
1941+ call TermWait(buf)
19421942
19431943 " closing window wipes out the terminal buffer a with finished job
19441944 call WaitForAssert({-> assert_equal(1, winnr('$'))})
@@ -2025,7 +2025,7 @@
20252025 END
20262026 call writefile(lines, 'XtermNormal')
20272027 let buf = RunVimInTerminal('-S XtermNormal', {'rows': 8})
2028- call term_wait(buf)
2028+ call TermWait(buf)
20292029
20302030 call term_sendkeys(buf, "\<C-W>N")
20312031 call term_sendkeys(buf, ":set number cursorline culopt=both\r")
@@ -2215,7 +2215,7 @@
22152215 call assert_equal('', term_gettty(buf + 1))
22162216
22172217 call StopShellInTerminal(buf)
2218- call term_wait(buf)
2218+ call TermWait(buf)
22192219 exe buf . 'bwipe'
22202220 endfunc
22212221
@@ -2255,7 +2255,7 @@
22552255 \ 'echo getwinpos()',
22562256 \ ], 'XTest_getwinpos')
22572257 let buf = RunVimInTerminal('-S XTest_getwinpos', {'cols': 60})
2258- call term_wait(buf)
2258+ call TermWait(buf)
22592259
22602260 " Find the output of getwinpos() in the bottom line.
22612261 let rows = term_getsize(buf)[0]
@@ -2278,7 +2278,7 @@
22782278 call assert_inrange(xroot + 2, xroot + xoff, xpos)
22792279 call assert_inrange(yroot + 2, yroot + yoff, ypos)
22802280
2281- call term_wait(buf)
2281+ call TermWait(buf)
22822282 call term_sendkeys(buf, ":q\<CR>")
22832283 call StopVimInTerminal(buf)
22842284 call delete('XTest_getwinpos')
@@ -2434,11 +2434,11 @@
24342434 \ ]
24352435 call writefile(lines, 'XtermPopup')
24362436 let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15})
2437- call term_wait(buf, 200)
2437+ call TermWait(buf, 100)
24382438 call term_sendkeys(buf, ":call OpenTerm(0)\<CR>")
2439- call term_wait(buf, 200)
2439+ call TermWait(buf, 100)
24402440 call term_sendkeys(buf, ":\<CR>")
2441- call term_wait(buf, 200)
2441+ call TermWait(buf, 100)
24422442 call term_sendkeys(buf, "\<C-W>:echo getwinvar(g:winid, \"&buftype\") win_gettype(g:winid)\<CR>")
24432443 call VerifyScreenDump(buf, 'Test_terminal_popup_1', {})
24442444
@@ -2446,7 +2446,7 @@
24462446 call VerifyScreenDump(buf, 'Test_terminal_popup_2', {})
24472447
24482448 call term_sendkeys(buf, ":call OpenTerm(1)\<CR>")
2449- call term_wait(buf, 300)
2449+ call TermWait(buf, 150)
24502450 call term_sendkeys(buf, ":set hlsearch\<CR>")
24512451 call term_sendkeys(buf, "/edit\<CR>")
24522452 call VerifyScreenDump(buf, 'Test_terminal_popup_3', {})
@@ -2454,7 +2454,7 @@
24542454 call term_sendkeys(buf, "\<C-W>:call HidePopup()\<CR>")
24552455 call VerifyScreenDump(buf, 'Test_terminal_popup_4', {})
24562456 call term_sendkeys(buf, "\<CR>")
2457- call term_wait(buf, 100)
2457+ call TermWait(buf, 50)
24582458
24592459 call term_sendkeys(buf, "\<C-W>:call ClosePopup()\<CR>")
24602460 call VerifyScreenDump(buf, 'Test_terminal_popup_5', {})
@@ -2470,9 +2470,9 @@
24702470 call term_sendkeys(buf, "A")
24712471 call VerifyScreenDump(buf, 'Test_terminal_popup_8', {})
24722472
2473- call term_wait(buf, 100)
2473+ call TermWait(buf, 50)
24742474 call term_sendkeys(buf, ":q\<CR>")
2475- call term_wait(buf, 200) " wait for terminal to vanish
2475+ call TermWait(buf, 100) " wait for terminal to vanish
24762476
24772477 call StopVimInTerminal(buf)
24782478 call delete('Xtext')
@@ -2499,16 +2499,16 @@
24992499 \ ]
25002500 call writefile(lines, 'XtermPopup')
25012501 let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15})
2502- call term_wait(buf, 200)
2502+ call TermWait(buf, 100)
25032503 call term_sendkeys(buf, ":set noruler\<CR>")
25042504 call term_sendkeys(buf, ":call OpenTerm()\<CR>")
2505- call term_wait(buf, 100)
2505+ call TermWait(buf, 50)
25062506 call term_sendkeys(buf, ":\<CR>")
25072507 call VerifyScreenDump(buf, 'Test_terminal_popup_m1', {})
25082508
2509- call term_wait(buf, 100)
2509+ call TermWait(buf, 50)
25102510 call term_sendkeys(buf, ":q\<CR>")
2511- call term_wait(buf, 100) " wait for terminal to vanish
2511+ call TermWait(buf, 50) " wait for terminal to vanish
25122512 call StopVimInTerminal(buf)
25132513 call delete('Xtext')
25142514 call delete('XtermPopup')
@@ -2531,17 +2531,17 @@
25312531 \ ]
25322532 call writefile(lines, 'XtermPopup')
25332533 let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15})
2534- call term_wait(buf, 200)
2534+ call TermWait(buf, 100)
25352535 call term_sendkeys(buf, ":set noruler\<CR>")
25362536 call term_sendkeys(buf, ":call OpenTerm()\<CR>")
2537- call term_wait(buf, 100)
2537+ call TermWait(buf, 50)
25382538 call term_sendkeys(buf, "hello\<CR>")
25392539 call VerifyScreenDump(buf, 'Test_terminal_popup_' .. a:group_name, {})
25402540
25412541 call term_sendkeys(buf, "\<C-D>")
2542- call term_wait(buf, 100)
2542+ call TermWait(buf, 50)
25432543 call term_sendkeys(buf, ":q\<CR>")
2544- call term_wait(buf, 100) " wait for terminal to vanish
2544+ call TermWait(buf, 50) " wait for terminal to vanish
25452545 call StopVimInTerminal(buf)
25462546 call delete('XtermPopup')
25472547 endfunc
@@ -2594,19 +2594,19 @@
25942594 let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'})
25952595 call popup_create(g:buf1, {})
25962596 let g:buf2 = term_start(['sh', '-c'], #{curwin: 1, exit_cb: function('TermExit')})
2597- call term_wait(g:buf2, 100)
2597+ call TermWait(g:buf2, 50)
25982598 call popup_close(win_getid())
25992599 endfunc
26002600 func TermExit(...)
26012601 let altbuf = bufnr('#')
26022602 call term_sendkeys(altbuf, "exit\<CR>")
2603- call term_wait(altbuf)
2603+ call TermWait(altbuf)
26042604 call popup_close(win_getid())
26052605 endfunc
26062606 call OpenTerms()
26072607
26082608 call term_sendkeys(g:buf0, "exit\<CR>")
2609- call term_wait(g:buf0, 100)
2609+ call TermWait(g:buf0, 50)
26102610 exe g:buf0 .. 'bwipe!'
26112611 set hidden&
26122612 endfunc
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_terminal_fail.vim
--- a/src/testdir/test_terminal_fail.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_terminal_fail.vim Wed Apr 08 22:00:05 2020 +0200
@@ -10,7 +10,7 @@
1010 func Test_terminal_redir_fails()
1111 if has('unix')
1212 let buf = term_start('xyzabc', {'err_io': 'file', 'err_name': 'Xfile'})
13- call term_wait(buf)
13+ call TermWait(buf)
1414 call WaitFor('len(readfile("Xfile")) > 0')
1515 call assert_match('executing job failed', readfile('Xfile')[0])
1616 call WaitFor('!&modified')
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_timers.vim
--- a/src/testdir/test_timers.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_timers.vim Wed Apr 08 22:00:05 2020 +0200
@@ -398,9 +398,9 @@
398398 call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))})
399399
400400 " GC must not run during timer callback, which can make Vim crash.
401- call term_wait(buf, 100)
401+ call TermWait(buf, 50)
402402 call term_sendkeys(buf, "\<CR>")
403- call term_wait(buf, 100)
403+ call TermWait(buf, 50)
404404 call assert_equal('run', job_status(job))
405405
406406 call term_sendkeys(buf, ":qall!\<CR>")
diff -r 313ad6f6fdb5 -r c087099e9163 src/testdir/test_vimscript.vim
--- a/src/testdir/test_vimscript.vim Wed Apr 08 20:15:05 2020 +0200
+++ b/src/testdir/test_vimscript.vim Wed Apr 08 22:00:05 2020 +0200
@@ -1913,30 +1913,30 @@
19131913
19141914 " Deep nesting of if ... endif
19151915 call term_sendkeys(buf, ":call Test1()\n")
1916- call term_wait(buf)
1916+ call TermWait(buf)
19171917 call WaitForAssert({-> assert_match('^E579:', term_getline(buf, 5))})
19181918
19191919 " Deep nesting of for ... endfor
19201920 call term_sendkeys(buf, ":call Test2()\n")
1921- call term_wait(buf)
1921+ call TermWait(buf)
19221922 call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))})
19231923
19241924 " Deep nesting of while ... endwhile
19251925 call term_sendkeys(buf, ":call Test3()\n")
1926- call term_wait(buf)
1926+ call TermWait(buf)
19271927 call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))})
19281928
19291929 " Deep nesting of try ... endtry
19301930 call term_sendkeys(buf, ":call Test4()\n")
1931- call term_wait(buf)
1931+ call TermWait(buf)
19321932 call WaitForAssert({-> assert_match('^E601:', term_getline(buf, 5))})
19331933
19341934 " Deep nesting of function ... endfunction
19351935 call term_sendkeys(buf, ":call Test5()\n")
1936- call term_wait(buf)
1936+ call TermWait(buf)
19371937 call WaitForAssert({-> assert_match('^E1058:', term_getline(buf, 4))})
19381938 call term_sendkeys(buf, "\<C-C>\n")
1939- call term_wait(buf)
1939+ call TermWait(buf)
19401940
19411941 "let l = ''
19421942 "for i in range(1, 6)
diff -r 313ad6f6fdb5 -r c087099e9163 src/version.c
--- a/src/version.c Wed Apr 08 20:15:05 2020 +0200
+++ b/src/version.c Wed Apr 08 22:00:05 2020 +0200
@@ -739,6 +739,8 @@
739739 static int included_patches[] =
740740 { /* Add new patch number below this line */
741741 /**/
742+ 533,
743+/**/
742744 532,
743745 /**/
744746 531,
Show on old repository browser