Unit Test process does not exit
See original GitHub issueI may have discovered why we see really weird unit test behavior sometimes…
I started using ReSharper’s Unit Test Explorer instead of the one built into VS2022. It reports that the test processes has not exited and offers to kill it:
Diving into this, I think I found the culprit, but am not 100% sure yet:
FakeDriver creates a thread in IMainLoopDriver.Setup and this thread never exits:
I think we either need a way to have that thread not always be running, or we need to add APIs that enable Application.Shutdown to signal the driver to clean up. Right now MainLoop.Stop is ONLY called from unit tests and even if it were called from elsewhere (e.g. Application.ResetState) it has no API available to signal a IMainLoopDriver implementation to clean up.
I’m looking more at this, but if anyone has a simple suggestion for fixing this I’d love to hear it.
Issue Analytics
- State:
- Created 4 months ago
- Comments:8

Top Related StackOverflow Question
@BDisp & @tznind - I was able to get three free ReSharper licenses for this project (via their open source program).
Please let me know if you’d like to start using Resharper. I don’t like a lot of things about it, but their unit Test Explorer is way better than the built-in VS2022 version. I’ll need some way to get you the license info other than GIthub (e.g. email).
This is another issue and I have this issue a lot of times. Mostly when toggle from v2 to v1. The culprit is the
VBCSCompiler.exewhich sometimes lock the output folder due a failed prior compile. Closing the solution and reopen again may resolve or not. Delete thebinandobjfolders may resolve or not. Also happens that restoreVisual Studio 2022doesn’t resolve and many times on after I killed theVBCSCompiler.exeresolves. That a eternal issue that was never be fixed.