-
Notifications
You must be signed in to change notification settings - Fork 20
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
Undisposed instances keep on running forever #8
Comments
So I guess even the finalizer does not catch these cases. Would the static inventory work - I mean that is killed as well by Visual Studio right? How about checking for running process on startup in thread? How would we recognise processes? Could we perhaps tag them with a special argument or something? Alternatively we could keep a list of processid's somewhere as app-data? |
Every new instance get's a process named by guid. Prefixing that by something quite obvious shouldn't beetoo hard. Also a static inventory would help keeping track of instances that are still needed (for example parallel test execution scenarios á la xunit. Another approach is to dig in to VS testing infra. At the time a debug session crashes (like VS does every once in a while) there must be some event that we could hook up. Funny enough, killing denenv.exe process does not kill the rogue instances. I'm not aware of the exact details, but it would be kinda great if one could wire the child process to be killed when the host process (vstest.host.exe or something similar) is killed? |
Not the best to depend on Visual Studio test infrastructure or specific host processes I think. Found some alternatives on this SO thread: https://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed So I see three solutions:
|
I have a little NuGet process runner that might help for this: Use like using (var proc = new ProcessHost("my.exe", @"C:\temp\")) {
proc.StartAsChild();
} |
Sometimes when your tests fails, thanks to Visual Studios rock solid (pun-intended) testing runtime, the executable does not get disposed. It would be neat, if we could find a way to kill parentless processes. PowerShell script could run every once in a while in a buildagent VM or redis-inside could use some static shared inventory of started processes. I'd be happy to help with PR if we could first discuss the outlines of the design.
The text was updated successfully, but these errors were encountered: