Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Frequent focus loss
kentcb
#1 Posted : Thursday, December 8, 2016 10:36:29 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/10/2016(UTC)
Posts: 20
Location: Australia

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
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
#2 Posted : Thursday, December 8, 2016 10:42:58 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
1 user thanked Remco for this useful post.
kentcb on 12/9/2016(UTC)
kentcb
#3 Posted : Friday, December 9, 2016 12:36:05 AM(UTC)
Rank: Member

Groups: Registered
Joined: 2/10/2016(UTC)
Posts: 20
Location: Australia

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
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.
1 user thanked kentcb for this useful post.
Remco on 12/9/2016(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download