]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3518: Test_xrestore sometimes fails v8.2.3518
authorBram Moolenaar <Bram@vim.org>
Sat, 16 Oct 2021 12:00:14 +0000 (13:00 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 16 Oct 2021 12:00:14 +0000 (13:00 +0100)
Problem:    Test_xrestore sometimes fails.
Solution:   Mark the test as flayky.  Move marking test as flaky to the test
            instead of listing them in runtest.

16 files changed:
src/testdir/runtest.vim
src/testdir/test_autocmd.vim
src/testdir/test_channel.vim
src/testdir/test_clientserver.vim
src/testdir/test_diffmode.vim
src/testdir/test_functions.vim
src/testdir/test_gui.vim
src/testdir/test_mapping.vim
src/testdir/test_paste.vim
src/testdir/test_popup.vim
src/testdir/test_quotestar.vim
src/testdir/test_reltime.vim
src/testdir/test_terminal.vim
src/testdir/test_terminal2.vim
src/testdir/test_timers.vim
src/version.c

index 2ef0f554fe792f6eb8a1dc5fcade0a2b6c3ce670..cc45393da6bf51f86e9d18f8d43ab48da5f318fc 100644 (file)
@@ -404,42 +404,6 @@ else
   endtry
 endif
 
-" Names of flaky tests.
-let s:flaky_tests = [
-      \ 'Test_BufWrite_lockmarks()',
-      \ 'Test_autocmd_SafeState()',
-      \ 'Test_bufunload_all()',
-      \ 'Test_client_server()',
-      \ 'Test_close_and_exit_cb()',
-      \ 'Test_close_output_buffer()',
-      \ 'Test_collapse_buffers()',
-      \ 'Test_cwd()',
-      \ 'Test_diff_screen()',
-      \ 'Test_exit_callback_interval()',
-      \ 'Test_map_timeout_with_timer_interrupt()',
-      \ 'Test_out_cb()',
-      \ 'Test_pipe_through_sort_all()',
-      \ 'Test_pipe_through_sort_some()',
-      \ 'Test_popup_and_window_resize()',
-      \ 'Test_quoteplus()',
-      \ 'Test_quotestar()',
-      \ 'Test_reltime()',
-      \ 'Test_state()',
-      \ 'Test_terminal_composing_unicode()',
-      \ 'Test_terminal_does_not_truncate_last_newlines()',
-      \ 'Test_terminal_no_cmd()',
-      \ 'Test_terminal_noblock()',
-      \ 'Test_terminal_redir_file()',
-      \ 'Test_termwinscroll()',
-      \ 'Test_timer_oneshot()',
-      \ 'Test_timer_paused()',
-      \ 'Test_timer_repeat_many()',
-      \ 'Test_timer_repeat_three()',
-      \ 'Test_timer_stop_all_in_callback()',
-      \ 'Test_timer_stop_in_callback()',
-      \ 'Test_timer_with_partial_callback()',
-      \ ]
-
 " Locate Test_ functions and execute them.
 redir @q
 silent function /^Test_
@@ -491,8 +455,7 @@ for g:testfunc in sort(s:tests)
   " - it fails five times (with a different message)
   if len(v:errors) > 0
         \ && $TEST_NO_RETRY == ''
-        \ && (index(s:flaky_tests, g:testfunc) >= 0
-        \      || g:test_is_flaky)
+        \ && g:test_is_flaky
     while 1
       call add(s:messages, 'Found errors in ' . g:testfunc . ':')
       call extend(s:messages, v:errors)
index 7faa4551d17afe35cbf889618879b2b35d4f0326..3893b79a651d53e82cf76225cff2a5fc01afcfce 100644 (file)
@@ -1490,6 +1490,7 @@ endfunc
 
 " Test for BufUnload autocommand that unloads all the other buffers
 func Test_bufunload_all()
+  let g:test_is_flaky = 1
   call writefile(['Test file Xxx1'], 'Xxx1')"
   call writefile(['Test file Xxx2'], 'Xxx2')"
 
@@ -2378,6 +2379,7 @@ endfunc
 
 func Test_autocmd_SafeState()
   CheckRunVimInTerminal
+  let g:test_is_flaky = 1
 
   let lines =<< trim END
        let g:safe = 0
@@ -2458,6 +2460,7 @@ func Test_autocmd_was_using_freed_memory()
 endfunc
 
 func Test_BufWrite_lockmarks()
+  let g:test_is_flaky = 1
   edit! Xtest
   call setline(1, ['a', 'b', 'c', 'd'])
 
index fbe6a842876c3a28db4a64c9c20bd1524d43166e..f8cdef4fc7531a45a03651ce82f66a1dd8ac2e46 100644 (file)
@@ -795,6 +795,7 @@ func Test_pipe_to_buffer_name_nomsg()
 endfunc
 
 func Test_close_output_buffer()
+  let g:test_is_flaky = 1
   enew!
   let test_lines = ['one', 'two']
   call setline(1, test_lines)
@@ -935,6 +936,7 @@ endfunc
 
 func Run_pipe_through_sort(all, use_buffer)
   CheckExecutable sort
+  let g:test_is_flaky = 1
 
   let options = {'out_io': 'buffer', 'out_name': 'sortout'}
   if a:use_buffer
@@ -1206,6 +1208,7 @@ func Test_reuse_channel()
 endfunc
 
 func Test_out_cb()
+  let g:test_is_flaky = 1
   let dict = {'thisis': 'dict: '}
   func dict.outHandler(chan, msg) dict
     if type(a:msg) == v:t_string
@@ -1333,6 +1336,7 @@ func Test_out_cb_lambda()
 endfunc
 
 func Test_close_and_exit_cb()
+  let g:test_is_flaky = 1
   let g:retdict = {'ret': {}}
   func g:retdict.close_cb(ch) dict
     let self.ret['close_cb'] = a:ch->ch_getjob()->job_status()
@@ -1560,6 +1564,7 @@ endfunction
 
 func Test_exit_callback_interval()
   CheckFunction reltimefloat
+  let g:test_is_flaky = 1
 
   let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0}
   let job = [s:python, '-c', 'import time;time.sleep(0.5)']->job_start({'exit_cb': 'MyExitTimeCb'})
@@ -1742,6 +1747,7 @@ func Test_using_freed_memory()
 endfunc
 
 func Test_collapse_buffers()
+  let g:test_is_flaky = 1
   CheckExecutable cat
 
   sp test_channel.vim
@@ -1884,6 +1890,7 @@ func Test_env()
 endfunc
 
 func Test_cwd()
+  let g:test_is_flaky = 1
   let g:envstr = ''
   if has('win32')
     let expect = $TEMP
index a088e178f7449a2e9d8df191166aa99428131585..03d201ddf4723e0cce024e6ebd9ae93822663717 100644 (file)
@@ -26,6 +26,7 @@ func Check_X11_Connection()
 endfunc
 
 func Test_client_server()
+  let g:test_is_flaky = 1
   let cmd = GetVimCommand()
   if cmd == ''
     throw 'GetVimCommand() failed'
index 268c3e9b54063e02f0c86259091af7cd7cfa0455..08ec71b9187286ca3ad3ffb691c81fbd1c1b223c 100644 (file)
@@ -845,6 +845,7 @@ func VerifyInternal(buf, dumpfile, extra)
 endfunc
 
 func Test_diff_screen()
+  let g:test_is_flaky = 1
   CheckScreendump
   CheckFeature menu
 
index d060ac418f94a3ba2f26db6bc62b84529fdb5cc8..7dd1894fa1db2dc150302889475a5f54cfc60ad7 100644 (file)
@@ -2286,6 +2286,7 @@ endfunc
 
 func Test_state()
   CheckRunVimInTerminal
+  let g:test_is_flaky = 1
 
   let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\<CR>"
 
index c01151cc3f92d15efde724d724db7597f60f3a09..6b849c747e971bff9d73f8b37b1026542986c457 100644 (file)
@@ -120,6 +120,7 @@ func Test_getwinpos()
 endfunc
 
 func Test_quoteplus()
+  let g:test_is_flaky = 1
   let skipped = ''
 
   if !g:x11_based_gui
index a447ba32f3797e81420b5e19a5ef5fb4d02ac92d..d2b9f37d10ca36e769fed908b2c7834662151f13 100644 (file)
@@ -289,6 +289,7 @@ endfunc
 func Test_map_timeout_with_timer_interrupt()
   CheckFeature job
   CheckFeature timers
+  let g:test_is_flaky = 1
 
   " Confirm the timer invoked in exit_cb of the job doesn't disturb mapped key
   " sequence.
@@ -1155,7 +1156,7 @@ func Test_map_cmdkey_visual_mode()
   call feedkeys("v\<F4>", 'xt!')
   call assert_equal(['v', 1, 12], [mode(1), col('v'), col('.')])
 
-  " can invoke an opeartor, ending the visual mode
+  " can invoke an operator, ending the visual mode
   let @a = ''
   call feedkeys("\<F5>", 'xt!')
   call assert_equal('n', mode(1))
index ef35cec806503027924926d57489965c1ca05af5..c94fe7c357edc62371e4aa3d4edb51db7c7f49d9 100644 (file)
@@ -136,6 +136,8 @@ endfunc
 
 func Test_xrestore()
   CheckFeature xterm_clipboard
+  let g:test_is_flaky = 1
+
   let display = $DISPLAY
   new
   call CheckCopyPaste()
index 0799df54807c4376319764cee0fa03196bddba3c..2f29163edebc8121fa45c7d1013400c99eefc27d 100644 (file)
@@ -665,6 +665,7 @@ func Test_popup_and_window_resize()
   CheckFeature terminal
   CheckFeature quickfix
   CheckNotGui
+  let g:test_is_flaky = 1
 
   let h = winheight(0)
   if h < 15
index 6b8aebfff7fcaadcbbb73aba67193c528a2bf893..b669019d8efbeb5ce75f73b48886f140f0519be1 100644 (file)
@@ -131,6 +131,7 @@ func Do_test_quotestar_for_x11()
 endfunc
 
 func Test_quotestar()
+  let g:test_is_flaky = 1
   let skipped = ''
 
   let quotestar_saved = @*
index c76d7a1684ef823e57f95a2a8ef9c9cc43ea68de..2f2e7aed7ed5b0421a966d471cd628e678248759 100644 (file)
@@ -5,6 +5,7 @@ CheckFeature reltime
 CheckFeature float
 
 func Test_reltime()
+  let g:test_is_flaky = 1
   let now = reltime()
   sleep 10m
   let later = reltime()
index 3944294e3c59aba6efd96f0ca3eab9c25031675e..eb5924a3010a31c37492fb5a8d929e0c1c1b368b 100644 (file)
@@ -698,6 +698,7 @@ func Test_terminal_list_args()
 endfunction
 
 func Test_terminal_noblock()
+  let g:test_is_flaky = 1
   let buf = term_start(&shell)
   let wait_time = 5000
   let letters = 'abcdefghijklmnopqrstuvwxyz'
@@ -805,6 +806,7 @@ func Test_terminal_duplicate_eof_arg()
 endfunc
 
 func Test_terminal_no_cmd()
+  let g:test_is_flaky = 1
   let buf = term_start('NONE', {})
   call assert_notequal(0, buf)
 
@@ -855,6 +857,7 @@ func Test_terminal_wrong_options()
 endfunc
 
 func Test_terminal_redir_file()
+  let g:test_is_flaky = 1
   let cmd = Get_cat_123_cmd()
   let buf = term_start(cmd, {'out_io': 'file', 'out_name': 'Xfile'})
   call TermWait(buf)
@@ -946,6 +949,7 @@ func Test_terminal_wqall()
 endfunc
 
 func Test_terminal_composing_unicode()
+  let g:test_is_flaky = 1
   let save_enc = &encoding
   set encoding=utf-8
 
index 0f8dcb672e200e630ddcb69f74dda1935865d3db..68f9ad8682b7bd80ad65376a316a7e612792f504 100644 (file)
@@ -217,6 +217,7 @@ func Test_termwinscroll()
   CheckUnix
   " TODO: Somehow this test sometimes hangs in the GUI
   CheckNotGui
+  let g:test_is_flaky = 1
 
   " Let the terminal output more than 'termwinscroll' lines, some at the start
   " will be dropped.
@@ -412,6 +413,7 @@ func Test_terminal_does_not_truncate_last_newlines()
   if has('conpty')
     throw 'Skipped: fail on ConPTY'
   endif
+  let g:test_is_flaky = 1
   let contents = [
   \   [ 'One', '', 'X' ],
   \   [ 'Two', '', '' ],
index caeeed6e53242398eb9cfc8135d92866dbcacea1..865a03b6d023fd499c3885779ca4ac6ab2b63f8b 100644 (file)
@@ -16,6 +16,7 @@ func MyHandlerWithLists(lists, timer)
 endfunc
 
 func Test_timer_oneshot()
+  let g:test_is_flaky = 1
   let g:val = 0
   let timer = timer_start(50, 'MyHandler')
   let slept = WaitFor('g:val == 1')
@@ -34,6 +35,7 @@ func Test_timer_oneshot()
 endfunc
 
 func Test_timer_repeat_three()
+  let g:test_is_flaky = 1
   let g:val = 0
   let timer = timer_start(50, 'MyHandler', {'repeat': 3})
   let slept = WaitFor('g:val == 3')
@@ -51,6 +53,7 @@ func Test_timer_repeat_three()
 endfunc
 
 func Test_timer_repeat_many()
+  let g:test_is_flaky = 1
   let g:val = 0
   let timer = timer_start(50, 'MyHandler', {'repeat': -1})
   sleep 200m
@@ -64,6 +67,7 @@ func Test_timer_repeat_many()
 endfunc
 
 func Test_timer_with_partial_callback()
+  let g:test_is_flaky = 1
   let g:val = 0
   let meow = {'one': 1}
   function meow.bite(...)
@@ -127,6 +131,7 @@ func Test_timer_stopall()
 endfunc
 
 func Test_timer_paused()
+  let g:test_is_flaky = 1
   let g:val = 0
 
   let id = timer_start(50, 'MyHandler')
@@ -186,6 +191,7 @@ func StopTimer2(timer)
 endfunc
 
 func Test_timer_stop_in_callback()
+  let g:test_is_flaky = 1
   call assert_equal(0, len(timer_info()))
   let g:timer1 = timer_start(10, 'StopTimer1')
   let slept = 0
@@ -205,6 +211,7 @@ func StopTimerAll(timer)
 endfunc
 
 func Test_timer_stop_all_in_callback()
+  let g:test_is_flaky = 1
   call assert_equal(0, len(timer_info()))
   call timer_start(10, 'StopTimerAll')
   call assert_equal(1, len(timer_info()))
@@ -471,4 +478,5 @@ func Test_timer_outputting_message()
   call delete('XTest_timermessage')
 endfunc
 
+
 " vim: shiftwidth=2 sts=2 expandtab
index d142759e5653b53d87ad8801c27fb85ed7c8ea44..1464dc22d914ea58275dec7f148bec0711e7b4a6 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3518,
 /**/
     3517,
 /**/