Module: wine Branch: master Commit: 54f04370ebd11abfd305fbc23ca0200cc329d278 URL: https://source.winehq.org/git/wine.git/?a=commit;h=54f04370ebd11abfd305fbc23...
Author: Kevin Puetz PuetzKevinA@JohnDeere.com Date: Thu Nov 5 17:09:11 2020 -0600
ole32/tests: Fix flaky test in cowait_unmarshal_thread.
When run with runtest -q (WINETEST_DEBUG=0) it passed within the first 50ms, but with any verbose logging it sometimes failed.
Use CoWaitForMultipleHandles (which keeps pumping the STA) since cowait_unmarshal_thread only releases its marshaled unk at the end, so it needs to be able to call back in order to exit cleanly.
Signed-off-by: Kevin Puetz PuetzKevinA@JohnDeere.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ole32/tests/compobj.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index 5ed3f9638b1..0d7f3d8adee 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -2772,8 +2772,9 @@ static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError()); hr = CoWaitForMultipleHandles(0, 50, 1, &event, &index); ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr); - index = WaitForSingleObject(thread, 200); - ok(index == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); + hr = CoWaitForMultipleHandles(0, 200, 1, &thread, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08x\n", hr); + ok(index == WAIT_OBJECT_0, "cowait_unmarshal_thread didn't finish"); CloseHandle(thread);
hr = CoRegisterMessageFilter(NULL, NULL);