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.
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index b17e450..fcbadfd 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -672,7 +672,7 @@
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,
\ screen_line[18].attr, screen_line[19].attr]
@@ -792,12 +792,12 @@
call WaitForAssert({-> assert_equal(lines, [term_getline(buf, 1), term_getline(buf, 2)])})
" wait for vim to complete initialization
- call term_wait(buf)
+ call TermWait(buf)
" Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight
call term_sendkeys(buf, ":set incsearch hlsearch\<cr>")
call term_sendkeys(buf, '/b')
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
let screen_line1 = term_scrape(buf, 1)
call assert_true(len(screen_line1) > 2)
" a0: attr_normal
@@ -813,7 +813,7 @@
" Test incremental highlight search
call term_sendkeys(buf, "/vim")
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
" Buffer:
" abb vim vim vi
" vimvivim
@@ -825,7 +825,7 @@
" Test <C-g>
call term_sendkeys(buf, "\<C-g>\<C-g>")
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0]
let attr_line2 = [a1,a1,a1,a0,a0,a2,a2,a2]
call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
@@ -833,7 +833,7 @@
" Test <C-t>
call term_sendkeys(buf, "\<C-t>")
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a1,a1,a1,a0,a0,a0]
let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2]
call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
@@ -841,7 +841,7 @@
" Type Enter and a1(incsearch highlight) should become a2(hlsearch highlight)
call term_sendkeys(buf, "\<cr>")
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0]
let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2]
call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
@@ -851,7 +851,7 @@
call term_sendkeys(buf, ":1\<cr>")
call term_sendkeys(buf, ":set nohlsearch\<cr>")
call term_sendkeys(buf, "/vim")
- call term_wait(buf, 200)
+ call TermWait(buf, 100)
let attr_line1 = [a0,a0,a0,a0,a1,a1,a1,a0,a0,a0,a0,a0,a0,a0]
let attr_line2 = [a0,a0,a0,a0,a0,a0,a0,a0]
call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))