Commit 96da5a8a authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

advapi32/tests: Fix a service stop race condition.

If some Windows services stop while testing EnumServicesStatusW()'s resume handle support, one possibility is that the still running services all fit in the specified buffer, invalidating the test so there is a retry in place. But in some cases the second call just returns fewer tests than expected. So retry in that case too. Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=53460
parent 58155d3e
......@@ -1370,6 +1370,8 @@ static BOOL test_enum_svc(int attempt)
goto retry; /* service start race condition */
ok(ret, "Expected success, got error %lu\n", GetLastError());
ok(needed == 0, "Expected 0 needed bytes as we are done, got %lu\n", needed);
if (returned < missing && strcmp(winetest_platform, "wine") && attempt)
goto retry; /* service stop race condition */
todo_wine ok(returned == missing, "Expected %lu remaining services, got %lu\n", missing, returned);
ok(resume == 0, "Expected the resume handle to be 0\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment