Comments (9)
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.
from xunit-teamcity.
@taliesins I've made a fix for this now, available in version 1.1.3. Could you give it a try?
from xunit-teamcity.
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.
from xunit-teamcity.
@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).
I'm a bit surprised that xUnit would not handle this more gracefully, I'll do some reading and see if there's kinder ways than Process.destroy()
to stop.
from xunit-teamcity.
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.
from xunit-teamcity.
https://github.com/xunit/xunit/blob/master/src/xunit.console/Program.cs
Send ctrl + c, sleep, send ctrl + c, sleep, process.destroy()
from xunit-teamcity.
Yes, part of the problem is that ctrl+c
isn't really a character that can be sent to an input stream, it is a keystroke which is interpreted by the shell when you are running it interactively.
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)
from xunit-teamcity.
I think I may have an easy solution for you.
http://www.latenighthacking.com/projects/2003/sendSignal/
https://github.com/walware/statet/tree/master/de.walware.statet.r.console.core/win32
So pass the process id to sendsignal.exe and it will send ctrl+c to the process.
from xunit-teamcity.
@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 Process
class' many shortcomings include not exposing the PID. That could of course be solved by enumerating all processes and looking for the test runner. However, quite a few deployments of TeamCity (including some of those I work with, despite my protests) run several agents on the same machines. When this happens, it will not be possible to know which process should be targeted.
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)?
from xunit-teamcity.
Related Issues (20)
- runner missing from zip HOT 2
- Teamcity Version 10.0.1 and version 1.1.3a HOT 1
- Support for xUnit 2.2.0? HOT 3
- Missing 2.2.0 in Runner Parameters HOT 2
- Add build step -> xUnit -> no parameters show up HOT 8
- No assemblies were matched - no tests will be run! HOT 6
- Teamcity variables are not expanded in assembly list HOT 2
- Does this support team city and net core? HOT 5
- 'Test Failure' reported as 'Success' in TeamCity when message contains Unicode ’ char (RIGHT SINGLE QUOTATION MARK) HOT 3
- Update .Net Framework requirements to support framework 4.7 HOT 6
- Release 1.2.1 is not available in the TeamCity plugins area HOT 1
- Agent requirements not met - no compatible agents HOT 2
- Output message in each project nested to deep hierarchy HOT 3
- xUnit console runner fails to execute some (random) tests on Team City HOT 2
- Support for xUnit 2.4.0 HOT 4
- Platform parameter gets reset to default value when editing the step HOT 9
- can't select higher than 4.5 version of .NET Runtime HOT 2
- Version 1.3.0, but in teamcity-plugin.xml, version is 1.1.0 HOT 1
- aspnet 5.0 HOT 1
- TLS error during test runs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xunit-teamcity.