Reset the actual vimspector, not a fresh one
This commit is contained in:
parent
325d39b64d
commit
17b85d2d72
2 changed files with 4 additions and 47 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue