mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
vim-patch:8.2.0400: not all tests using a terminal are in the list of flaky tests
Problem: Not all tests using a terminal are in the list of flaky tests. Solution: Introduce the test_is_flaky flag.3cdcb090a6
Cherry-pick g:test_is_flaky from patch v8.2.0557. Ensure that test_is_flaky variable is set from the global scope.. N/A patches for version.c: vim-patch:8.2.2647: terminal test sometimes hangs Problem: Terminal test sometimes hangs. Solution: Wait for the shell to display a prompt.f4a2ed0714
vim-patch:8.2.2648: terminal resize test sometimes hangs Problem: Terminal resize test sometimes hangs. Solution: Wait for the shell to display a prompt and other output.c54f347d63
fixup! vim-patch:8.2.0400: not all tests using a terminal are in the list of flaky tests
This commit is contained in:
@@ -373,9 +373,6 @@ let s:flaky_tests = [
|
|||||||
\ 'Test_with_partial_callback()',
|
\ 'Test_with_partial_callback()',
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
" Pattern indicating a common flaky test failure.
|
|
||||||
let s:flaky_errors_re = 'StopVimInTerminal\|VerifyScreenDump'
|
|
||||||
|
|
||||||
" Locate Test_ functions and execute them.
|
" Locate Test_ functions and execute them.
|
||||||
redir @q
|
redir @q
|
||||||
silent function /^Test_
|
silent function /^Test_
|
||||||
@@ -410,6 +407,9 @@ for s:test in sort(s:tests)
|
|||||||
let total_errors = []
|
let total_errors = []
|
||||||
let run_nr = 1
|
let run_nr = 1
|
||||||
|
|
||||||
|
" A test can set g:test_is_flaky to retry running the test.
|
||||||
|
let g:test_is_flaky = 0
|
||||||
|
|
||||||
call RunTheTest(s:test)
|
call RunTheTest(s:test)
|
||||||
|
|
||||||
" Repeat a flaky test. Give up when:
|
" 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)
|
" - it fails five times (with a different message)
|
||||||
if len(v:errors) > 0
|
if len(v:errors) > 0
|
||||||
\ && (index(s:flaky_tests, s:test) >= 0
|
\ && (index(s:flaky_tests, s:test) >= 0
|
||||||
\ || v:errors[0] =~ s:flaky_errors_re)
|
\ || g:test_is_flaky)
|
||||||
while 1
|
while 1
|
||||||
call add(s:messages, 'Found errors in ' . s:test . ':')
|
call add(s:messages, 'Found errors in ' . s:test . ':')
|
||||||
call extend(s:messages, v:errors)
|
call extend(s:messages, v:errors)
|
||||||
|
@@ -1366,9 +1366,11 @@ func Test_TextChangedI_with_setline()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_Changed_FirstTime()
|
func Test_Changed_FirstTime()
|
||||||
if !has('terminal') || has('gui_running')
|
CheckFeature terminal
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
" Starting a terminal to run Vim is always considered flaky.
|
||||||
|
let test_is_flaky = 1
|
||||||
|
|
||||||
" Prepare file for TextChanged event.
|
" Prepare file for TextChanged event.
|
||||||
call writefile([''], 'Xchanged.txt')
|
call writefile([''], 'Xchanged.txt')
|
||||||
let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3})
|
let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3})
|
||||||
|
Reference in New Issue
Block a user