From f6585cae50a7f1aef8544a6904bb7e986126283f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 23 Mar 2021 22:28:01 -0400 Subject: 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. https://github.com/vim/vim/commit/3cdcb090a664e182078f7cc0ca3e4e5a94bbb784 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. https://github.com/vim/vim/commit/f4a2ed071447ad4984fad55b9d1671b55140ae1c 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. https://github.com/vim/vim/commit/c54f347d63bcca97ead673d01ac6b59914bb04e5 fixup! vim-patch:8.2.0400: not all tests using a terminal are in the list of flaky tests --- src/nvim/testdir/runtest.vim | 8 ++++---- src/nvim/testdir/test_autocmd.vim | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 275edece1e..2d94b637e0 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -373,9 +373,6 @@ let s:flaky_tests = [ \ 'Test_with_partial_callback()', \ ] -" 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 g:test_is_flaky to retry running the test. + let g: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) + \ || g:test_is_flaky) while 1 call add(s:messages, 'Found errors in ' . s:test . ':') call extend(s:messages, v:errors) diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 7788e09d43..107428a62e 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -1366,9 +1366,11 @@ func Test_TextChangedI_with_setline() endfunc func Test_Changed_FirstTime() - if !has('terminal') || has('gui_running') - return - endif + 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') let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3}) -- cgit From b951d1ff1d52072912a8d65f654a7899fffb39d8 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 23 Mar 2021 22:32:38 -0400 Subject: vim-patch:8.2.0402: setting local instead of global flag Problem: Setting local instead of global flag. Solution: Prepend "g:" to "test_is_flaky". https://github.com/vim/vim/commit/30d53e2c11e670845830bdfc29bf8c1615df61a8 --- src/nvim/testdir/test_autocmd.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 107428a62e..3401e791c9 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -1369,7 +1369,7 @@ func Test_Changed_FirstTime() CheckFeature terminal CheckNotGui " Starting a terminal to run Vim is always considered flaky. - let test_is_flaky = 1 + let g:test_is_flaky = 1 " Prepare file for TextChanged event. call writefile([''], 'Xchanged.txt') -- cgit