]> granicus.if.org Git - vim/commitdiff
patch 9.0.0369: a failing flaky test doesn't mention the time v9.0.0369
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Sep 2022 12:58:47 +0000 (13:58 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Sep 2022 12:58:47 +0000 (13:58 +0100)
Problem:    A failing flaky test doesn't mention the time.
Solution:   Add the time for debugging.  Improve error message.

src/testdir/runtest.vim
src/testdir/shared.vim
src/version.c

index c7140e53000e231036d37cfe33ce564d69196193..91977c9491309b1b6351c81664924bc7124a0c5c 100644 (file)
@@ -465,6 +465,7 @@ for g:testfunc in sort(s:tests)
   " A test can set g:test_is_flaky to retry running the test.
   let g:test_is_flaky = 0
 
+  let starttime = strftime("%T")
   call RunTheTest(g:testfunc)
 
   " Repeat a flaky test.  Give up when:
@@ -475,10 +476,10 @@ for g:testfunc in sort(s:tests)
         \ && $TEST_NO_RETRY == ''
         \ && g:test_is_flaky
     while 1
-      call add(s:messages, 'Found errors in ' . g:testfunc . ':')
+      call add(s:messages, 'Found errors in ' .. g:testfunc .. ':')
       call extend(s:messages, v:errors)
 
-      call add(total_errors, 'Run ' . g:run_nr . ':')
+      call add(total_errors, starttime .. ' Run ' .. g:run_nr .. ':')
       call extend(total_errors, v:errors)
 
       if g:run_nr >= 5 || prev_error == v:errors[0]
@@ -498,6 +499,7 @@ for g:testfunc in sort(s:tests)
       let v:errors = []
       let g:run_nr += 1
 
+      let starttime = strftime("%T")
       call RunTheTest(g:testfunc)
 
       if len(v:errors) == 0
index 0f0ffe878a7bc1c6788be959bfab72801214461e..72cf8368cf2aa41a97e8d2e42855985780a14ca8 100644 (file)
@@ -98,16 +98,16 @@ func RunServer(cmd, testfunc, args)
   try
     let g:currentJob = RunCommand(pycmd)
 
-    " Wait for up to 2 seconds for the port number to be there.
+    " Wait for some time for the port number to be there.
     let port = GetPort()
     if port == 0
-      call assert_false(1, "Can't start " . a:cmd)
+      call assert_report(strftime("%T") .. " Can't start " .. a:cmd)
       return
     endif
 
     call call(function(a:testfunc), [port])
   catch
-    call assert_false(1, 'Caught exception: "' . v:exception . '" in ' . v:throwpoint)
+    call assert_report('Caught exception: "' . v:exception . '" in ' . v:throwpoint)
   finally
     call s:kill_server(a:cmd)
   endtry
index b2e28e29701aa89c84850e2defa2db59040e366c..9eba6bf33552b3a273c51884f9df5a685a8d52ec 100644 (file)
@@ -707,6 +707,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    369,
 /**/
     368,
 /**/