https://bugs.winehq.org/show_bug.cgi?id=39644
Bug ID: 39644 Summary: WineTest.exe should detect left-over UAC prompts Product: Wine Version: 1.8-rc1 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: testcases Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
There was a problem where the cmd.exe:batch would try to run regedit from an account without elevated privileges. This caused Windows to pop up the UAC dialog, causing the test to stall. Timeout would happen, WineTest would kill the cmd.exe:batch process but doing so, and even extending it to all process tree, does not close the UAC because it's under the control of another Windows element. So WineTest would run the following tests with the UAC dialog still up which caused them to fail as they could not put their windows in the foreground.
The cmd.exe:batch bug has been fixed. However it could make sense for WineTest to do more to handle this situation more nicely: * If possible it could dismiss the UAC dialog (not click 'Yes' obviously, just deny the request). * It could detect the UAC dialog is up and wait. It seems the UAC dialog goes away on its own after about two minutes. * If we cannot detect if an UAC dialog is up we could systematically wait for an extra 2 minutes after a timeout, just in case. * Even more basic, we could increase our test timeout so it's longer than the UAC timeout, in the hope an UAC would go away before we time out. * Even though it does not solve the UAC issue it could still make sense to kill the whole subprocess tree, just to be sure one of them is not going to break the following tests.
https://bugs.winehq.org/show_bug.cgi?id=39644
--- Comment #1 from François Gouget fgouget@codeweavers.com --- Created attachment 52846 --> https://bugs.winehq.org/attachment.cgi?id=52846 Kill the process tree in case of a timeout.
The attached patch kills the process tree in case a test process times out. As noted above this does not help avoid left-over UAC dialogs.
https://bugs.winehq.org/show_bug.cgi?id=39644
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=39644
Zhiyi Zhang yi.gd.cn@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |yi.gd.cn@gmail.com
--- Comment #2 from Zhiyi Zhang yi.gd.cn@gmail.com --- Hi François,
After reviewing your code, I realize your attached patch didn't always kill the process tree. Do you think it's related ?
https://bugs.winehq.org/show_bug.cgi?id=39644
Zhiyi Zhang zzhang@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zzhang@codeweavers.com
--- Comment #3 from Zhiyi Zhang zzhang@codeweavers.com --- The kill tree recursion didn't consider the problem of modifying the same position in snapshot. That's the Process32First and Process32Next loop.
https://bugs.winehq.org/show_bug.cgi?id=39644
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #52846|0 |1 is obsolete| |
--- Comment #4 from François Gouget fgouget@codeweavers.com --- Created attachment 74051 --> https://bugs.winehq.org/attachment.cgi?id=74051 winetest: Kill the whole child process tree
Fixed the patch to kill the whole child process tree in case a test process times out.
https://bugs.winehq.org/show_bug.cgi?id=39644
--- Comment #5 from François Gouget fgouget@codeweavers.com --- Rather than explicitly going through the child process tree and killing each process, it may be simpler and more thorough to put child processes in a job and use TerminateJobObject(). But maybe this would interfere with the tests...
The next step is to check whether this recursive killing makes any difference wrt. UAC prompts. But Even if it does not, it may make sense to do it anyway, even in non-timeout cases, just to make sure a test does not leave processes behind that could interfere with the tests that follow.