Skip to content

Commit 15e737f

Browse files
committed
patch 8.0.0480: the remote_peek() test fails on MS-Windows
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.
1 parent 6caf606 commit 15e737f

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

src/os_mswin.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,6 +2526,7 @@ serverGetReply(HWND server, int *expr_res, int remove, int wait)
25262526
int i;
25272527
char_u *reply;
25282528
reply_T *rep;
2529+
int did_process = FALSE;
25292530

25302531
/* When waiting, loop until the message waiting for is received. */
25312532
for (;;)
@@ -2562,7 +2563,17 @@ serverGetReply(HWND server, int *expr_res, int remove, int wait)
25622563
/* If we got here, we didn't find a reply. Return immediately if the
25632564
* "wait" parameter isn't set. */
25642565
if (!wait)
2566+
{
2567+
/* Process pending messages once. Without this, looping on
2568+
* remote_peek() would never get the reply. */
2569+
if (!did_process)
2570+
{
2571+
did_process = TRUE;
2572+
serverProcessPendingMessages();
2573+
continue;
2574+
}
25652575
break;
2576+
}
25662577

25672578
/* We need to wait for a reply. Enter a message loop until the
25682579
* "reply_received" flag gets set. */

src/testdir/runtest.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,17 @@ for s:test in sort(s:tests)
250250
call add(s:messages, 'Found errors in ' . s:test . ':')
251251
call extend(s:messages, v:errors)
252252
call add(s:messages, 'Flaky test failed, running it again')
253+
let first_run = v:errors
254+
253255
let v:errors = []
254256
call RunTheTest(s:test)
257+
if len(v:errors) > 0
258+
let second_run = v:errors
259+
let v:errors = ['First run:']
260+
call extend(v:errors, first_run)
261+
call add(v:errors, 'Second run:')
262+
call extend(v:errors, second_run)
263+
endif
255264
endif
256265

257266
call AfterTheTest()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
480,
767769
/**/
768770
479,
769771
/**/

0 commit comments

Comments
 (0)