Just wondering if anyone else is experiencing this since the v3 upgrade...
I've found that I'll be typing away in VS, only for the focus to be moved elsewhere (I have no idea where because typing does nothing). If I wait a while, it will come back, or I can hit Escape and it returns immediately. This happens literally every 10 seconds or so, so you can imagine how annoying it is.
I've only noticed this since upgrading to NCrunch 3, so I'm wondering whether it has anything to do with it. If I disable NCrunch, it _does_ appear to stop the focus-stealing behavior.
Help!
Remco NCrunch Developer
#9507
08 Dec 2016 22:42 UTC
Hi, thanks for sharing this issue.
V3 didn't introduce any changes that I would immediately suspect of this. Though there is some history here. The following features of NCrunch use a popup dialog that in older versions has sometimes stolen focus from the main VS window:
- Notification of new version of NCrunch
- Static window that appears when you choose to show coverage for a specific test or group of tests
- Window that appears when you have high-priority tests in the processing queue and the engine is at full capacity and unable to immediately process them
- Window that appears when you change engine mode
- Window that appears when you queue high priority tests for execution
In all situations where this happened, it would be immediately obvious that this window would steal focus. Several fixes were introduced to target this problem and I haven't seen it for a good long while.
It's also quite possible that you have code under test that is somehow doing this. It's possible to track this down by selectively running sections of your test suite through to completion until you can figure out which test is responsible.
V3 didn't introduce any changes that I would immediately suspect of this. Though there is some history here. The following features of NCrunch use a popup dialog that in older versions has sometimes stolen focus from the main VS window:
- Notification of new version of NCrunch
- Static window that appears when you choose to show coverage for a specific test or group of tests
- Window that appears when you have high-priority tests in the processing queue and the engine is at full capacity and unable to immediately process them
- Window that appears when you change engine mode
- Window that appears when you queue high priority tests for execution
In all situations where this happened, it would be immediately obvious that this window would steal focus. Several fixes were introduced to target this problem and I haven't seen it for a good long while.
It's also quite possible that you have code under test that is somehow doing this. It's possible to track this down by selectively running sections of your test suite through to completion until you can figure out which test is responsible.
Thanks for the tip, Remco. I investigated per your advice and found I had a test that was triggering a code path that invoked System.Diagnostics.Debugger.Break(). I should have noticed because the execution time of the test was > 5s, but somehow it escaped me. Anyway, by ensuring that it doesn't trigger Debugger.Break() I solved both problems: the test is now fast and there is no focus-stealing.
Post a reply
Log in to reply.