Paul Gofman (@gofman) commented about dlls/ntdll/tests/sync.c:
- };
- unsigned int i, iterations;
- unsigned int noyields[2] = {0, 0}; /* [0] = non-alertable, [1] = alertable */
- unsigned int apc_status_count[2] = {0, 0}; /* [0] = zero timeout, [1] = non-zero timeout */
- LARGE_INTEGER timeout;
- ULONG apc_count;
- NTSTATUS status;
- DWORD ret;
- for (i = 0; i < ARRAY_SIZE(tests); i++)
- {
winetest_push_context("%s", tests[i].desc);
/* run zero-timeout tests a lot more to catch possibly flaky (but very unlikely) NO_YIELD_PERFORMED */
iterations = tests[i].timeout ? 100 : 10000;
while (iterations--)
This is actually a very long time for test. Mind that by default on Windows 1ms sleep will me 16ms sleep, so 100 times is 160ms. One potential thing to do is to break early once you encountered the status (instead of count arrays which you don't probably need anyway), but I still suggest to make just the one time test which will allow either status. It is clear enough for documentation, and in the present form it is still flaky, such things tend to break going forward. Your test in initial form wasn't a waste, it provided the evidence that that status indeed happens, but we probably don't have to keep this proof if it is flaky.