]> granicus.if.org Git - vim/commitdiff
patch 8.2.4862: Vim9: test may fail when run with valgrind v8.2.4862
authorBram Moolenaar <Bram@vim.org>
Wed, 4 May 2022 15:24:57 +0000 (16:24 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 4 May 2022 15:24:57 +0000 (16:24 +0100)
Problem:    Vim9: test may fail when run with valgrind.
Solution:   Wait longer for callback if needed.

src/testdir/test_vim9_script.vim
src/version.c

index 4a01daa39e6d51c68fb4de966dc8587fe257d693..23b3502ce70db54109fc46dc40e4de952e0dc503 100644 (file)
@@ -3707,6 +3707,7 @@ def Test_no_unknown_error_after_error()
       enddef
       def Exit_cb(...l: list<any>)
           sleep 1m
+          g:did_call_exit_cb = true
           source += l
       enddef
       var myjob = job_start('echo burp', {out_cb: Out_cb, exit_cb: Exit_cb, mode: 'raw'})
@@ -3714,7 +3715,13 @@ def Test_no_unknown_error_after_error()
         sleep 10m
       endwhile
       # wait for Exit_cb() to be called
-      sleep 200m
+      for x in range(100)
+        if exists('g:did_call_exit_cb')
+          unlet g:did_call_exit_cb
+          break
+        endif
+        sleep 10m
+      endfor
   END
   writefile(lines, 'Xdef')
   assert_fails('so Xdef', ['E684:', 'E1012:'])
index 51db458263560f60b4c74492ca50fdf0ee01861b..5277fef5ea9d125e0afe7778d2607996ad74e9ba 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4862,
 /**/
     4861,
 /**/