summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-18 19:18:10 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-18 19:18:10 +0100
commit3cdcb090a664e182078f7cc0ca3e4e5a94bbb784 (patch)
tree18d7686880a240523e7177b39d97b5670d73db52
parent292b90d4fa11022661f449dd3efb73d5ac737313 (diff)
downloadvim-git-3cdcb090a664e182078f7cc0ca3e4e5a94bbb784.tar.gz
patch 8.2.0400: not all tests using a terminal are in the list of flaky testsv8.2.0400
Problem: Not all tests using a terminal are in the list of flaky tests. Solution: Introduce the test_is_flaky flag.
-rw-r--r--src/testdir/runtest.vim8
-rw-r--r--src/testdir/screendump.vim3
-rw-r--r--src/testdir/term_util.vim6
-rw-r--r--src/testdir/test_autocmd.vim2
-rw-r--r--src/version.c2
5 files changed, 17 insertions, 4 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index d8a1cf730..b7f922969 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -379,9 +379,6 @@ let s:flaky_tests = [
\ 'Test_zz1_terminal_in_gui()',
\ ]
-" Pattern indicating a common flaky test failure.
-let s:flaky_errors_re = 'StopVimInTerminal\|VerifyScreenDump'
-
" Locate Test_ functions and execute them.
redir @q
silent function /^Test_
@@ -410,6 +407,9 @@ for s:test in sort(s:tests)
let total_errors = []
let run_nr = 1
+ " A test can set test_is_flaky to retry running the test.
+ let test_is_flaky = 0
+
call RunTheTest(s:test)
" Repeat a flaky test. Give up when:
@@ -417,7 +417,7 @@ for s:test in sort(s:tests)
" - it fails five times (with a different message)
if len(v:errors) > 0
\ && (index(s:flaky_tests, s:test) >= 0
- \ || v:errors[0] =~ s:flaky_errors_re)
+ \ || test_is_flaky)
while 1
call add(s:messages, 'Found errors in ' . s:test . ':')
call extend(s:messages, v:errors)
diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim
index d04d96d98..14863f9ae 100644
--- a/src/testdir/screendump.vim
+++ b/src/testdir/screendump.vim
@@ -24,6 +24,9 @@ func VerifyScreenDump(buf, filename, options, ...)
let reference = 'dumps/' . a:filename . '.dump'
let testfile = 'failed/' . a:filename . '.dump'
+ " Starting a terminal to make a screendump is always considered flaky.
+ let test_is_flaky = 1
+
" Redraw to execute the code that updates the screen. Otherwise we get the
" text and attributes only from the internal buffer.
redraw
diff --git a/src/testdir/term_util.vim b/src/testdir/term_util.vim
index 4eaf6d8be..c9e0ac528 100644
--- a/src/testdir/term_util.vim
+++ b/src/testdir/term_util.vim
@@ -93,11 +93,17 @@ func RunVimInTerminal(arguments, options)
call assert_report('RunVimInTerminal() failed, screen contents: ' . join(lines, "<NL>"))
endtry
+ " Starting a terminal to run Vim is always considered flaky.
+ let test_is_flaky = 1
+
return buf
endfunc
" Stop a Vim running in terminal buffer "buf".
func StopVimInTerminal(buf)
+ " Using a terminal to run Vim is always considered flaky.
+ let test_is_flaky = 1
+
call assert_equal("running", term_getstatus(a:buf))
" CTRL-O : works both in Normal mode and Insert mode to start a command line.
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 7e3035ae4..84c46cf91 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -1868,6 +1868,8 @@ endfunc
func Test_Changed_FirstTime()
CheckFeature terminal
CheckNotGui
+ " Starting a terminal to run Vim is always considered flaky.
+ let test_is_flaky = 1
" Prepare file for TextChanged event.
call writefile([''], 'Xchanged.txt')
diff --git a/src/version.c b/src/version.c
index 686e045c0..10ec2429c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 400,
+/**/
399,
/**/
398,