]> granicus.if.org Git - vim/commitdiff
patch 8.2.0400: not all tests using a terminal are in the list of flaky tests v8.2.0400
authorBram Moolenaar <Bram@vim.org>
Wed, 18 Mar 2020 18:18:10 +0000 (19:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 18 Mar 2020 18:18:10 +0000 (19:18 +0100)
Problem:    Not all tests using a terminal are in the list of flaky tests.
Solution:   Introduce the test_is_flaky flag.

src/testdir/runtest.vim
src/testdir/screendump.vim
src/testdir/term_util.vim
src/testdir/test_autocmd.vim
src/version.c

index d8a1cf730ab204ef76d3e7a4c3a1b154eb41a20a..b7f922969851469732b0f490ccb1e4d105fcaaa9 100644 (file)
@@ -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)
index d04d96d983a110348bc4db44cbdfb13637a789e5..14863f9ae4014e2b05b7f70a261c884387d7ef3b 100644 (file)
@@ -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
index 4eaf6d8beedbf7971ad98ddec7ab3ea0cdc98c4d..c9e0ac528085381a6eabafc82d20d3e6a20a7497 100644 (file)
@@ -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.
index 7e3035ae42a6b1ca622727322a1843e5ea39974e..84c46cf91e213032fc0ee4a8c057dc0ec3846f9d 100644 (file)
@@ -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')
index 686e045c01eb57247a23109662871eb7d223578e..10ec2429c0ba51fb1eef5c5dfee24994517f5a23 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    400,
 /**/
     399,
 /**/