0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 7.4.1454

Problem:    The exit callback test is flaky.
Solution:   Loop to wait for a short time up to a second.
This commit is contained in:
Bram Moolenaar 2016-02-28 19:50:51 +01:00
parent 9bfdba3de3
commit 9730f74a0b
2 changed files with 15 additions and 4 deletions

View File

@ -535,14 +535,21 @@ endfunc
func Test_exit_callback() func Test_exit_callback()
if has('job') if has('job')
call ch_log('Test_exit_callback()')
call s:run_server('s:test_exit_callback') call s:run_server('s:test_exit_callback')
" the job may take a little while to exit " wait up to a second for the job to exit
sleep 50m for i in range(100)
if s:job_exit_ret == 'done'
break
endif
sleep 10m
" calling job_status() triggers the callback " calling job_status() triggers the callback
call job_status(s:exit_job) call job_status(s:exit_job)
endfor
call assert_equal('done', s:job_exit_ret) call assert_equal('done', s:job_exit_ret)
unlet s:exit_job
endif endif
endfunc endfunc
@ -571,3 +578,5 @@ func Test_close_callback()
call s:run_server('s:test_close_callback') call s:run_server('s:test_close_callback')
endfunc endfunc
" Uncomment this to see what happens, output is in src/testdir/channellog.
" call ch_logfile('channellog', 'w')

View File

@ -743,6 +743,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1454,
/**/ /**/
1453, 1453,
/**/ /**/