From 17b85d2d729ee2d04ce1be87bc953954d4e4d9d6 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Wed, 24 Jul 2019 17:16:56 +0100 Subject: [PATCH] Reset the actual vimspector, not a fresh one --- tests/lib/autoload/vimspector/test/setup.vim | 7 ++-- tests/lib/run_test.vim | 44 -------------------- 2 files changed, 4 insertions(+), 47 deletions(-) diff --git a/tests/lib/autoload/vimspector/test/setup.vim b/tests/lib/autoload/vimspector/test/setup.vim index 012549f..c12c433 100644 --- a/tests/lib/autoload/vimspector/test/setup.vim +++ b/tests/lib/autoload/vimspector/test/setup.vim @@ -14,9 +14,6 @@ function! vimspector#test#setup#SetUpWithMappings( mappings ) abort endfunction function! vimspector#test#setup#ClearDown() abort - if exists( '*vimspector#internal#state#Reset' ) - call vimspector#internal#state#Reset() - endif endfunction function! vimspector#test#setup#Reset() abort @@ -31,5 +28,9 @@ function! vimspector#test#setup#Reset() abort call vimspector#test#signs#AssertSignGroupEmpty( 'VimspectorCode' ) call vimspector#ClearBreakpoints() call vimspector#test#signs#AssertSignGroupEmpty( 'VimspectorBP' ) + + if exists( '*vimspector#internal#state#Reset' ) + call vimspector#internal#state#Reset() + endif endfunction diff --git a/tests/lib/run_test.vim b/tests/lib/run_test.vim index dc66d8b..f8cef56 100644 --- a/tests/lib/run_test.vim +++ b/tests/lib/run_test.vim @@ -317,51 +317,7 @@ 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 message) - 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:testid . ':') - call extend(s:messages, v:errors) - - call add(total_errors, 'Run ' . run_nr . ':') - call extend(total_errors, v:errors) - - 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() endfor