Skip to content

Commit 9730f74

Browse files
committed
patch 7.4.1454
Problem: The exit callback test is flaky. Solution: Loop to wait for a short time up to a second.
1 parent 9bfdba3 commit 9730f74

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/testdir/test_channel.vim

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,14 +535,21 @@ endfunc
535535

536536
func Test_exit_callback()
537537
if has('job')
538+
call ch_log('Test_exit_callback()')
538539
call s:run_server('s:test_exit_callback')
539540

540-
" the job may take a little while to exit
541-
sleep 50m
541+
" wait up to a second for the job to exit
542+
for i in range(100)
543+
if s:job_exit_ret == 'done'
544+
break
545+
endif
546+
sleep 10m
547+
" calling job_status() triggers the callback
548+
call job_status(s:exit_job)
549+
endfor
542550

543-
" calling job_status() triggers the callback
544-
call job_status(s:exit_job)
545551
call assert_equal('done', s:job_exit_ret)
552+
unlet s:exit_job
546553
endif
547554
endfunc
548555

@@ -571,3 +578,5 @@ func Test_close_callback()
571578
call s:run_server('s:test_close_callback')
572579
endfunc
573580

581+
" Uncomment this to see what happens, output is in src/testdir/channellog.
582+
" call ch_logfile('channellog', 'w')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1454,
746748
/**/
747749
1453,
748750
/**/

0 commit comments

Comments
 (0)