Francois Gouget : kernel32/tests: Avoid a race in test_WaitForJobObject().

Alexandre Julliard julliard at winehq.org
Mon Feb 24 15:23:53 CST 2020


Module: wine
Branch: master
Commit: 995b44fe6118a5bfb05549addbc33ba9b7767b88
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=995b44fe6118a5bfb05549addbc33ba9b7767b88

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Feb 24 05:03:29 2020 +0100

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

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 8e80bdba3a..c4db9483fe 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);




More information about the wine-cvs mailing list