-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancelling build does not cancel tests #14
Comments
Thanks for reporting! I will have a look - my assumption was that this was handled by the base class from the TeamCity API I extended, but I may have misread the documentation. |
@taliesins I've made a fix for this now, available in version 1.1.3. Could you give it a try? |
I clicked stop in TeamCity. The xUnit runner was killed, but child processes stayed alive. I was hoping it would also kill all child processes. So in the specflow scenario I landed up with 1 chromedriver.exe and 4 chrome.exe instances. I have hooked into the app domain unload event as well as creating a critical finalizer in the hope I can kill off the processes, but they stayed alive. |
@taliesins Hm, that turns out to be a bit tricky, it seems... Java does not support signalling or killing child processes, as far as I can see, due to it being hard to do in a cross platform manner. There are a few posts with hacks involving WMI around the net, but nothing that seems particularly robust (in your case we probably have multiple levels of subprocesses, for instance). |
Can you send ctrl+c twice sleep a bit then call process.destroy() as this would allow xunit to cancel itself gracefully and allow me to hook into subdomain unload. |
https://github.com/xunit/xunit/blob/master/src/xunit.console/Program.cs Send ctrl + c, sleep, send ctrl + c, sleep, process.destroy() |
Yes, part of the problem is that From what I've gathered, I'll need to get into JNA and send a Windows message to the application. I'm looking into exactly what I need to do for that (I'm don't do any Java development outside of this plugin, so it's a bit slow, I'm afraid) |
I think I may have an easy solution for you. http://www.latenighthacking.com/projects/2003/sendSignal/ So pass the process id to sendsignal.exe and it will send ctrl+c to the process. |
@taliesins First, thanks for taking an active part in resolving this :) I looked into sendsignal a bit, and I think there might be a few issues with that approach sadly. The Java As a temporary workaround, in case you do run multiple agents as described above, would it work for you to add an extra build step at the end of your build with the "Run always, even if build stop command was issued" execution policy which calls sendsignal (or something similar)? |
We have setup Specflow to run Webdriver using Xunit. We have noticed that if you stop a build in TeamCity it does not close xunit.console.exe.
This leaves test running in the background. I was expecting the process to be terminated, if the job is stopped in TeamCity.
The text was updated successfully, but these errors were encountered: