aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-07-07 21:37:37 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-07-15 23:07:29 -0400
commit5b8d378923baf538e0e9d6cee5ce4620470ecab3 (patch)
tree2deb7669789b695b0d32fdbafa04f2c150c2c39f
parent9108256ad4391516ba5dc37b36a751c71969598f (diff)
downloadrneovim-5b8d378923baf538e0e9d6cee5ce4620470ecab3.tar.gz
rneovim-5b8d378923baf538e0e9d6cee5ce4620470ecab3.tar.bz2
rneovim-5b8d378923baf538e0e9d6cee5ce4620470ecab3.zip
vim-patch:8.1.0531: flaky tests often fail with a common error message
Problem: Flaky tests often fail with a common error message. Solution: Add a pattern to match an error message indicating a flaky test. https://github.com/vim/vim/commit/dbc0d2163aa5e090d5a0c83aea448803ddbab664
-rw-r--r--src/nvim/testdir/runtest.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim
index 605e7c73eb..2f10019ad9 100644
--- a/src/nvim/testdir/runtest.vim
+++ b/src/nvim/testdir/runtest.vim
@@ -263,7 +263,7 @@ else
endif
" Names of flaky tests.
-let s:flaky = [
+let s:flaky_tests = [
\ 'Test_cursorhold_insert()',
\ 'Test_exit_callback_interval()',
\ 'Test_oneshot()',
@@ -281,6 +281,9 @@ let s:flaky = [
\ 'Test_lambda_with_timer()',
\ ]
+" Pattern indicating a common flaky test failure.
+let s:flaky_errors_re = 'StopVimInTerminal'
+
" Locate Test_ functions and execute them.
redir @q
silent function /^Test_
@@ -305,7 +308,9 @@ for s:test in sort(s:tests)
" 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
+ if len(v:errors) > 0
+ \ && (index(s:flaky_tests, s:test) >= 0
+ \ || v:errors[0] =~ s:flaky_errors_re)
while 1
call add(s:messages, 'Found errors in ' . s:test . ':')
call extend(s:messages, v:errors)