]> granicus.if.org Git - vim/commitdiff
patch 8.0.0480: the remote_peek() test fails on MS-Windows v8.0.0480
authorBram Moolenaar <Bram@vim.org>
Sat, 18 Mar 2017 20:22:47 +0000 (21:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 18 Mar 2017 20:22:47 +0000 (21:22 +0100)
Problem:    The remote_peek() test fails on MS-Windows.
Solution:   Check for pending messages. Also report errors in the first run if
            a flaky test fails twice.

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

index 45b14783a5a9f854673da07b8e77a9d52028b5df..bddb08d920b93c4519aba427487b57acc63a6740 100644 (file)
@@ -2526,6 +2526,7 @@ serverGetReply(HWND server, int *expr_res, int remove, int wait)
     int                i;
     char_u     *reply;
     reply_T    *rep;
+    int                did_process = FALSE;
 
     /* When waiting, loop until the message waiting for is received. */
     for (;;)
@@ -2562,7 +2563,17 @@ serverGetReply(HWND server, int *expr_res, int remove, int wait)
        /* If we got here, we didn't find a reply. Return immediately if the
         * "wait" parameter isn't set.  */
        if (!wait)
+       {
+           /* Process pending messages once. Without this, looping on
+            * remote_peek() would never get the reply. */
+           if (!did_process)
+           {
+               did_process = TRUE;
+               serverProcessPendingMessages();
+               continue;
+           }
            break;
+       }
 
        /* We need to wait for a reply. Enter a message loop until the
         * "reply_received" flag gets set. */
index b896443780281b585880b9fbdd873fa950ec6ca4..1d694b5cf260d8e18deea4a1d9937b6dd901d57d 100644 (file)
@@ -250,8 +250,17 @@ for s:test in sort(s:tests)
     call add(s:messages, 'Found errors in ' . s:test . ':')
     call extend(s:messages, v:errors)
     call add(s:messages, 'Flaky test failed, running it again')
+    let first_run = v:errors
+
     let v:errors = []
     call RunTheTest(s:test)
+    if len(v:errors) > 0
+      let second_run = v:errors
+      let v:errors = ['First run:']
+      call extend(v:errors, first_run)
+      call add(v:errors, 'Second run:')
+      call extend(v:errors, second_run)
+    endif
   endif
 
   call AfterTheTest()
index cfafa3fd7ed5acbf79abbe3930632f75e83703d4..69b4990d2adb52329f98fb5f06f2777141f5b216 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    480,
 /**/
     479,
 /**/