nunit.exe session degrades with ever-lengthening "Reloading..." phase when test project is recompiled

Bug #673691 reported by Peter Bessman
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
NUnit V2
Fix Released
Medium
Charlie Poole

Bug Description

I'm using nunit to do unit testing for an ASP.NET MVC 2 project. I have a solution with two projects, one being the actual application, and the other being the unit tests. I use the nunit.exe gui to run the unit tests. I invoke the tests by opening up the dll produced by building the project.

The first few times everything runs smoothly, with nunit.exe automatically reloading the project when I make changes and rebuild. However, this starts to take a longer and longer amount of time, and eventually, it will get into loop where it says "Reloading..." and the window flickers for a second, says "Reloading...", lather rinse repeat. The behavior is very non-deterministic from what I can observe so far. Sometimes it's fine for ages, sometimes it dies immediately. Perhaps particular change to the project cause massive problems in nunit.exe. I am happy to investigate if someone can point me in the right direction.

Related branches

Revision history for this message
Christoph Nahr (diogenes) wrote :

I can confirm this bug, it's new in NUnit 2.5.8 and did not appear on my system in NUnit 2.5.7. That's on Windows 7 x64 with Visual Studio 10, testing a regular .NET DLL (not ASP.NET).

Revision history for this message
Christoph Nahr (diogenes) wrote :

Just noticed the likely cause: when I turn off the setting "Reload when test assembly changes", the GUI runner *still* reloads the test assembly whenever it changes -- but now only once! Seems this setting is evaluated incorrectly.

Revision history for this message
Peter Bessman (peter-peterbessman) wrote :

Good looking out Christoph, I can confirm the behavior you report -- unchecking "Reload when test assembly changes" fixes the behavior.

Revision history for this message
Christoph Nahr (diogenes) wrote :

Now I restarted the GUI runner and it no longer automatically reloads the test assembly when this option is unchecked! Okay, whatever it is, this option is clearly messed up in some way.

Changed in nunitv2:
status: New → Confirmed
Revision history for this message
Christoph Nahr (diogenes) wrote :

More data: While debugging a unit test with VS2010 with the Attach to Process feature, I noticed that reloading the test assembly creates additional nunit-agent processes that stay in memory until the GUI runner is shut down. There should be only one such process at any given time, correct?

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 673691] Re: nunit.exe session degrades with ever-lengthening "Reloading..." phase when test project is recompiled

There should only be one unless you are using the multiple process
setting, then there
would be one for each assembly. When reloading, the same process
should be reused
unless you make changes to settings that require a new process - for
example if you
change the version of .NET to be used. Even if a new process is needed, the old
one should be shut down.

Have you tried this with the latest 2.5.9 snapshot?

Charlie

On Sun, Nov 14, 2010 at 1:11 AM, Christoph Nahr
<email address hidden> wrote:
> More data:  While debugging a unit test with VS2010 with the Attach to
> Process feature, I noticed that reloading the test assembly creates
> additional nunit-agent processes that stay in memory until the GUI
> runner is shut down.  There should be only one such process at any given
> time, correct?
>
> --
> nunit.exe session degrades with ever-lengthening "Reloading..." phase when test project is recompiled
> https://bugs.launchpad.net/bugs/673691
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

Changed in nunitv2:
importance: Undecided → Medium
Revision history for this message
Christoph Nahr (diogenes) wrote :

Sorry for the delay in responding, I forgot to subscribe to this bug -- perhaps automatically subscribing anyone who posts a reply would be a good idea.

I don't use the multiple process setting. The checked Assembly Isolation options are "Run tests directly in the NUnit process" and "Use a single AppDomain for all tests".

I haven't tried the latest snapshot yet but will do so now.

Revision history for this message
Christoph Nahr (diogenes) wrote :

Okay, I just tried 2.5.9.10320. This release no longer produces multiple nunit-agent.exe processes, but it still gets locked into lengthening "Reloading" cycles. This happens even when the "Reload assemblies when changed" setting is unchecked.

Revision history for this message
Charlie Poole (charlie.poole) wrote :

FYI, there is a bug about changes in the "Reload assemblies when
changed" setting not taking effect until NUnit is restarted.
Otherwise, the multiple reload cycles continue to be a problem that we
are working on.

Charlie

On Fri, Nov 19, 2010 at 4:14 AM, Christoph Nahr
<email address hidden> wrote:
> Okay, I just tried 2.5.9.10320.  This release no longer produces
> multiple nunit-agent.exe processes, but it still gets locked into
> lengthening "Reloading" cycles.  This happens even when the "Reload
> assemblies when changed" setting is unchecked.
>
> --
> nunit.exe session degrades with ever-lengthening "Reloading..." phase when test project is recompiled
> https://bugs.launchpad.net/bugs/673691
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

Revision history for this message
Koen De Groote (degroote-koen) wrote :

Running Windows 7 32-bit here. I can confirm comment #5, but when I shut NUnit down, the extra agents stay in memory.

I have not modified any settings, I tried it right away after I installed.

Screenshot: http://imgur.com/vMa10.png

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Hi Koen,

I'm hoping you are seeing this in 2.5.8, not in 2.5.9.10320.

Charlie

On Tue, Dec 7, 2010 at 5:54 AM, Koen De Groote
<email address hidden> wrote:
> Running Windows 7 32-bit here. I can confirm comment #5, but when I shut
> NUnit down, the extra agents stay in memory.
>
> I have not modified any settings, I tried it right away after I
> installed.
>
> Screenshot: http://imgur.com/vMa10.png
>
> --
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
> https://bugs.launchpad.net/bugs/673691
>
> Title:
>  nunit.exe session degrades with ever-lengthening "Reloading..." phase when test project is recompiled
>

Changed in nunitv2:
assignee: nobody → Charlie Poole (charlie.poole)
status: Confirmed → Fix Committed
milestone: none → 2.5.9
Changed in nunitv2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.