]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1454 v7.4.1454
authorBram Moolenaar <Bram@vim.org>
Sun, 28 Feb 2016 18:50:51 +0000 (19:50 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 28 Feb 2016 18:50:51 +0000 (19:50 +0100)
Problem:    The exit callback test is flaky.
Solution:   Loop to wait for a short time up to a second.

src/testdir/test_channel.vim
src/version.c

index b214fa988566457544950efa864b89bae1bb62a2..0fded018a35bf08fd4b43e4228d6b17cfbf554ea 100644 (file)
@@ -535,14 +535,21 @@ endfunc
 
 func Test_exit_callback()
   if has('job')
+    call ch_log('Test_exit_callback()')
     call s:run_server('s:test_exit_callback')
 
-    " the job may take a little while to exit
-    sleep 50m
+    " wait up to a second for the job to exit
+    for i in range(100)
+      if s:job_exit_ret == 'done'
+       break
+      endif
+      sleep 10m
+      " calling job_status() triggers the callback
+      call job_status(s:exit_job)
+    endfor
 
-    " calling job_status() triggers the callback
-    call job_status(s:exit_job)
     call assert_equal('done', s:job_exit_ret)
+    unlet s:exit_job
   endif
 endfunc
 
@@ -571,3 +578,5 @@ func Test_close_callback()
   call s:run_server('s:test_close_callback')
 endfunc
 
+" Uncomment this to see what happens, output is in src/testdir/channellog.
+" call ch_logfile('channellog', 'w')
index 991af8dbfbc5fc0c2b3e1b181c815d6c324db870..2c214708113e2616bd1fe763e0e6c9d3f3417d17 100644 (file)
@@ -743,6 +743,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1454,
 /**/
     1453,
 /**/