diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-06-08 14:19:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-08 14:19:35 +0200 |
commit | 230e75b63f165179a16d6e936fffe7bf3ebb1fdc (patch) | |
tree | 55c328bf10abb88053f9d0440821fb2a3c2a3719 | |
parent | bf16b14f46b9698becd46bb4e1751319219358b7 (diff) | |
parent | 7810c7ab761f58c40767af22de68ab884df84561 (diff) | |
download | rneovim-230e75b63f165179a16d6e936fffe7bf3ebb1fdc.tar.gz rneovim-230e75b63f165179a16d6e936fffe7bf3ebb1fdc.tar.bz2 rneovim-230e75b63f165179a16d6e936fffe7bf3ebb1fdc.zip |
Merge #10149 from blueyed/vim-8.1.0430
vim-patch:8.1.{0430,0529}
-rw-r--r-- | src/nvim/testdir/runtest.vim | 51 | ||||
-rw-r--r-- | src/nvim/testdir/test_arglist.vim | 1 |
2 files changed, 36 insertions, 16 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index bfd6240f0c..aaddc90c99 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -276,28 +276,47 @@ endif for s:test in sort(s:tests) " Silence, please! set belloff=all + let prev_error = '' + let total_errors = [] + let run_nr = 1 call RunTheTest(s:test) + " Repeat a flaky test. Give up when: + " - it fails again with the same message + " - it fails five times (with a different mesage) if len(v:errors) > 0 && index(s:flaky, s:test) >= 0 - call add(s:messages, 'Found errors in ' . s:test . ':') - call extend(s:messages, v:errors) - call add(s:messages, 'Flaky test failed, running it again') - let first_run = v:errors + while 1 + call add(s:messages, 'Found errors in ' . s:test . ':') + call extend(s:messages, v:errors) - " Flakiness is often caused by the system being very busy. Sleep a couple - " of seconds to have a higher chance of succeeding the second time. - sleep 2 + call add(total_errors, 'Run ' . run_nr . ':') + call extend(total_errors, v:errors) - let v:errors = [] - call RunTheTest(s:test) - if len(v:errors) > 0 - let second_run = v:errors - let v:errors = ['First run:'] - call extend(v:errors, first_run) - call add(v:errors, 'Second run:') - call extend(v:errors, second_run) - endif + if run_nr == 5 || prev_error == v:errors[0] + call add(total_errors, 'Flaky test failed too often, giving up') + let v:errors = total_errors + break + endif + + call add(s:messages, 'Flaky test failed, running it again') + + " Flakiness is often caused by the system being very busy. Sleep a + " couple of seconds to have a higher chance of succeeding the second + " time. + sleep 2 + + let prev_error = v:errors[0] + let v:errors = [] + let run_nr += 1 + + call RunTheTest(s:test) + + if len(v:errors) == 0 + " Test passed on rerun. + break + endif + endwhile endif call AfterTheTest() diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index 3a9ffbdbf3..6468819198 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -74,6 +74,7 @@ func Test_argadd() call assert_equal(1, len(argv())) call assert_equal('some file', get(argv(), 0, '')) + call delete('Xargadd') %argd new arga |