mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 19:35:37 +00:00
@@ -276,28 +276,47 @@ endif
|
|||||||
for s:test in sort(s:tests)
|
for s:test in sort(s:tests)
|
||||||
" Silence, please!
|
" Silence, please!
|
||||||
set belloff=all
|
set belloff=all
|
||||||
|
let prev_error = ''
|
||||||
|
let total_errors = []
|
||||||
|
let run_nr = 1
|
||||||
|
|
||||||
call RunTheTest(s:test)
|
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
|
if len(v:errors) > 0 && index(s:flaky, s:test) >= 0
|
||||||
|
while 1
|
||||||
call add(s:messages, 'Found errors in ' . s:test . ':')
|
call add(s:messages, 'Found errors in ' . s:test . ':')
|
||||||
call extend(s:messages, v:errors)
|
call extend(s:messages, v:errors)
|
||||||
call add(s:messages, 'Flaky test failed, running it again')
|
|
||||||
let first_run = v:errors
|
|
||||||
|
|
||||||
" Flakiness is often caused by the system being very busy. Sleep a couple
|
call add(total_errors, 'Run ' . run_nr . ':')
|
||||||
" of seconds to have a higher chance of succeeding the second time.
|
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
|
sleep 2
|
||||||
|
|
||||||
|
let prev_error = v:errors[0]
|
||||||
let v:errors = []
|
let v:errors = []
|
||||||
|
let run_nr += 1
|
||||||
|
|
||||||
call RunTheTest(s:test)
|
call RunTheTest(s:test)
|
||||||
if len(v:errors) > 0
|
|
||||||
let second_run = v:errors
|
if len(v:errors) == 0
|
||||||
let v:errors = ['First run:']
|
" Test passed on rerun.
|
||||||
call extend(v:errors, first_run)
|
break
|
||||||
call add(v:errors, 'Second run:')
|
|
||||||
call extend(v:errors, second_run)
|
|
||||||
endif
|
endif
|
||||||
|
endwhile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call AfterTheTest()
|
call AfterTheTest()
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ func Test_argadd()
|
|||||||
call assert_equal(1, len(argv()))
|
call assert_equal(1, len(argv()))
|
||||||
call assert_equal('some file', get(argv(), 0, ''))
|
call assert_equal('some file', get(argv(), 0, ''))
|
||||||
|
|
||||||
|
call delete('Xargadd')
|
||||||
%argd
|
%argd
|
||||||
new
|
new
|
||||||
arga
|
arga
|
||||||
|
|||||||
Reference in New Issue
Block a user