From 5b8d378923baf538e0e9d6cee5ce4620470ecab3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 7 Jul 2019 21:37:37 -0400 Subject: 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 --- src/nvim/testdir/runtest.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit