diff src/testdir/test_channel.vim @ 22969:dcb59b1cc0c1 v8.2.2031

patch 8.2.2031: some tests fail when run under valgrind Commit: https://github.com/vim/vim/commit/18dc355395f2eac72ab83d984cacd26ae61c791f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 22 14:24:00 2020 +0100 patch 8.2.2031: some tests fail when run under valgrind Problem: Some tests fail when run under valgrind. Solution: Avoid timing problems.
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 Nov 2020 14:30:06 +0100
parents ff21e2962490
children 515d1651c6c6
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -2181,18 +2181,21 @@ func Test_issue_5150()
   else
     let cmd = 'grep foo'
   endif
+
   let g:job = job_start(cmd, {})
+  sleep 50m  " give the job time to start
   call job_stop(g:job)
+  call WaitForAssert({-> assert_equal(-1, job_info(g:job).exitval)})
+
+  let g:job = job_start(cmd, {})
   sleep 50m
-  call assert_equal(-1, job_info(g:job).exitval)
-  let g:job = job_start(cmd, {})
   call job_stop(g:job, 'term')
-  sleep 50m
-  call assert_equal(-1, job_info(g:job).exitval)
+  call WaitForAssert({-> assert_equal(-1, job_info(g:job).exitval)})
+
   let g:job = job_start(cmd, {})
+  sleep 50m
   call job_stop(g:job, 'kill')
-  sleep 50m
-  call assert_equal(-1, job_info(g:job).exitval)
+  call WaitForAssert({-> assert_equal(-1, job_info(g:job).exitval)})
 endfunc
 
 func Test_issue_5485()