[PATCH] kernel32/tests: Avoid a race in test_WaitForJobObject().

Francois Gouget fgouget at codeweavers.com
Sun Feb 23 22:03:29 CST 2020


Waiting for and closing the job object does not kill the child process
which then may print its 'tests executed' line at the same time as the
parent traces, sometimes mangling failure messages.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 dlls/kernel32/tests/process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index 8e80bdba3a9..c4db9483fe5 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -2809,6 +2809,7 @@ static void test_WaitForJobObject(void)
     dwret = WaitForSingleObject(job, 100);
     ok(dwret == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", dwret);
 
+    WaitForSingleObject(pi.hProcess, 1000);
     CloseHandle(pi.hProcess);
     CloseHandle(pi.hThread);
     CloseHandle(job);
-- 
2.20.1




More information about the wine-devel mailing list