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>
This commit is contained in:
Kevin Puetz 2020-11-05 17:09:11 -06:00 committed by Alexandre Julliard
parent 1fc8a8f234
commit 54f04370eb
1 changed files with 3 additions and 2 deletions

View File

@ -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);