[PATCH] shell32/tests: Wait longer when pumping messages.

Zebediah Figura z.figura12 at gmail.com
Wed Jan 1 19:53:06 CST 2020


In an attempt to fix intermittent test failures.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
The failures are rare enough that it's hard to be sure this helps.

 dlls/shell32/tests/autocomplete.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c
index ce68d21f04..e75d5de347 100644
--- a/dlls/shell32/tests/autocomplete.c
+++ b/dlls/shell32/tests/autocomplete.c
@@ -442,11 +442,18 @@ static HRESULT string_enumerator_create(void **ppv, WCHAR **suggestions, int cou
 static void dispatch_messages(void)
 {
     MSG msg;
-    Sleep(33);
-    while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
+    int diff = 200;
+    DWORD time = GetTickCount() + diff;
+
+    while (diff > 0)
     {
-        TranslateMessage(&msg);
-        DispatchMessageA(&msg);
+        if (MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
+        while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
+        {
+            TranslateMessage(&msg);
+            DispatchMessageA(&msg);
+        }
+        diff = time - GetTickCount();
     }
 }
 
-- 
2.24.1




More information about the wine-devel mailing list