comparison src/testdir/test_channel.vim @ 8324:5e88bd55b789 v7.4.1454

commit https://github.com/vim/vim/commit/9730f74a0b2acb490943393a203a24ab8fab923a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 28 19:50:51 2016 +0100 patch 7.4.1454 Problem: The exit callback test is flaky. Solution: Loop to wait for a short time up to a second.
author Christian Brabandt <cb@256bit.org>
date Sun, 28 Feb 2016 20:00:04 +0100
parents ac0c43e7af20
children 8fa75a4c39bd
comparison
equal deleted inserted replaced
8323:0c749a0d66c3 8324:5e88bd55b789
533 let s:exit_job = s:job 533 let s:exit_job = s:job
534 endfunc 534 endfunc
535 535
536 func Test_exit_callback() 536 func Test_exit_callback()
537 if has('job') 537 if has('job')
538 call ch_log('Test_exit_callback()')
538 call s:run_server('s:test_exit_callback') 539 call s:run_server('s:test_exit_callback')
539 540
540 " the job may take a little while to exit 541 " wait up to a second for the job to exit
541 sleep 50m 542 for i in range(100)
542 543 if s:job_exit_ret == 'done'
543 " calling job_status() triggers the callback 544 break
544 call job_status(s:exit_job) 545 endif
546 sleep 10m
547 " calling job_status() triggers the callback
548 call job_status(s:exit_job)
549 endfor
550
545 call assert_equal('done', s:job_exit_ret) 551 call assert_equal('done', s:job_exit_ret)
552 unlet s:exit_job
546 endif 553 endif
547 endfunc 554 endfunc
548 555
549 """"""""" 556 """""""""
550 557
569 func Test_close_callback() 576 func Test_close_callback()
570 call ch_log('Test_close_callback()') 577 call ch_log('Test_close_callback()')
571 call s:run_server('s:test_close_callback') 578 call s:run_server('s:test_close_callback')
572 endfunc 579 endfunc
573 580
581 " Uncomment this to see what happens, output is in src/testdir/channellog.
582 " call ch_logfile('channellog', 'w')