Nunit agent hangs after test execution with version 2.5.8

843 views
Skip to first unread message

Samuel13

unread,
Oct 27, 2010, 7:50:43 AM10/27/10
to NUnit-Discuss
Hi everybody

After upgrading from 2.5.7 to 2.5.8 the nunit-agent.exe process hangs
after test execution (described under: https://bugs.launchpad.net/nunitv2/+bug/602761).

Is this bug still around?

Samuel

Charlie Poole

unread,
Oct 27, 2010, 9:29:48 AM10/27/10
to nunit-...@googlegroups.com
The bug was fixed and released using the suggestion of removing the
OneWay attribute.
Unfortunately, I never reproduced it in my environment, so I'm flying
blind here.

There's a small possibility that the fix didn't get into the release,
which I'll check.

Does it hang all all the time? Only when running under a particular
CLR version? Only on 64 bit? etc... :-)

Charlie

> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
>
>

Charlie Poole

unread,
Oct 27, 2010, 9:43:54 AM10/27/10
to nunit-...@googlegroups.com
The attribute was removed, as suggested by Andy. However, I see that there
is also a OneWayAttribute on the base class Stop method. It would be helpful
if somebody who can reproduce this problem would try the fix of removing the
attribute.

The other thing that would be useful would be to narrow it down to the
environment in which it occurs - it doesn't repro on any of my systems.

Charlie

Samuel13

unread,
Oct 27, 2010, 9:46:38 AM10/27/10
to NUnit-Discuss
I'm running NUnit console under NAnt (version 0.9.0). The test
assemblies are .NET 4.0 assemblies. Operating system is Windows XP 32
Bit.

The following task illustrates the usage of NUnit, there are multiple
assemblies which are tested at the same time:

<exec verbose="true" program='nunit-console-x86.exe'>
<arg value="${unittestfiles} /noshadow /framework=4.0 /
xml=UnitTests.TestResult.xml" />
</exec>


Rolled back to 2.5.7 and it worked perfectly again...


Samuel

Charlie Poole

unread,
Oct 27, 2010, 10:02:34 AM10/27/10
to nunit-...@googlegroups.com
This would lead me to suspect that the change actually made the problem
worse! Can you try running NUnit by itself, without using NAnt?

Charlie

Samuel13

unread,
Oct 27, 2010, 10:20:16 AM10/27/10
to NUnit-Discuss
Even if I run the NUnit console under a command window, the agent
process hangs after the test execution:

nunit-console-x86 TestAssembly.dll /noshadow /framework=4.0

Samuel

Charlie Poole

unread,
Oct 30, 2010, 1:59:18 PM10/30/10
to nunit-...@googlegroups.com
This may be related to but have a different cause from the original bug.

Can you clarify what you mean by "hangs"? Does the nunit-console process fail
to terminate? Are you left with orphaned processes?

Charlie

Andreas Öhlund

unread,
Oct 31, 2010, 6:38:34 AM10/31/10
to NUnit-Discuss
I'm having the same problem (both on 2.5.7 and 2.5.8). Nunit-agent.exe
hangs and prevents the build to complete


[echo] C:\Users\andreas.ohlund\dev\nservicebus\build\containers
\ObjectBuilder.Tests.dll
[exec] NUnit version 2.5.8.10295
[exec] Copyright (C) 2002-2009 Charlie Poole.
[exec] Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two,
Alexei A. Vorontsov.
[exec] Copyright (C) 2000-2002 Philip Craig.
[exec] All Rights Reserved.
[exec]
[exec] Runtime Environment -
[exec] OS Version: Microsoft Windows NT 6.1.7600.0
[exec] CLR Version: 2.0.50727.4952 ( Net 2.0 )
[exec]
[exec] ProcessModel: Default DomainUsage: Single
[exec] Execution Runtime: v4.0
[exec] ............
[exec] Tests run: 12, Errors: 0, Failures: 0, Inconclusive: 0,
Time: 2,5311528 seconds
[exec] Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
[exec]

BUILD SUCCEEDED
-- the build hangs here

Env: Win2008R2 x64

/Andreas

Charlie Poole

unread,
Oct 31, 2010, 9:34:01 AM10/31/10
to nunit-...@googlegroups.com
We seem to be discussing two problems here...

1) The nunit-agent process failing to terminate

2) The nunit-console process hanging

In my own tests, I observe #1 when using the Gui Runner. This is being tracked
as bug #612052.

However, I don't see #2 in my environment. Even though nunit-agent is left
running briefly, nunit-console terminates correctly and causes nunit-agent
to terminate as well.

If I read this correctly, Samuel has problem #1, while Andreas has #2.
So what's the difference I wonder?

Charlie

Andreas Öhlund

unread,
Oct 31, 2010, 11:02:24 AM10/31/10
to NUnit-Discuss
Sorry for being unclear. nunit-console.exe terminates for me but the
nunit-agent.exe hangs around for ever. So I'm also having problem #1

Cheers,

Andreas

Charlie Poole

unread,
Oct 31, 2010, 11:18:27 AM10/31/10
to nunit-...@googlegroups.com
Hi Andreas,

That's good, since I have solved #1. :-)

The fix is in bzr, for those who build from source.

Charlie

Andreas Öhlund

unread,
Oct 31, 2010, 12:20:34 PM10/31/10
to NUnit-Discuss
Do you guys have a CI server I can pick the latest build from? ( or do
I have to build from source?)

Eta for a public release? ( I want to get the NServiceBus build
running as soon as I can :)

Thanks for your hard work Charlie!

/Andreas

Charlie Poole

unread,
Oct 31, 2010, 1:50:05 PM10/31/10
to nunit-...@googlegroups.com
We don't, but we are currently talking about dropping development snapshots
'nightly' and I'll announce soon when it's available.

Charlie

Erich Eichinger

unread,
Oct 31, 2010, 6:32:40 PM10/31/10
to NUnit-Discuss
fyi, I just tried the dev snapshot of today (NUnit-2.5.9.10304.zip),
nunit-agent (and nunit-agent-x86) still hang

it is reproducible on my box with net-4.0. Running the tests w/
net-3.5 completes fine!

-Erich

On Oct 31, 6:50 pm, Charlie Poole <nunit...@gmail.com> wrote:
> We don't, but we are currently talking about dropping development snapshots
> 'nightly' and I'll announce soon when it's available.
>
> Charlie
>
> On Sun, Oct 31, 2010 at 9:20 AM, Andreas Öhlund
>

Charlie Poole

unread,
Oct 31, 2010, 7:05:02 PM10/31/10
to nunit-...@googlegroups.com
OK... now that the more general bug is gone, we can try to figure out
what the deal is with this one. Is it _only_ with console? What about
when you run the Gui? You should be able to load under .NET 4.0,
see an agent process created, unload and see it go away. Also, close
and see it go away. Additionally, reload tests should use the same
process. If all that works for you, then the bug has to be in the
console runner itself. If not, then it's bigger.

Charlie

Samuel13

unread,
Nov 2, 2010, 4:26:47 AM11/2/10
to NUnit-Discuss
Hi Charlie

Yes I had problem #1. With the current source (2.5.9.10305) the bug is
fixed...

Thanks
Samuel
> > For more options, visit this group athttp://groups.google.com/group/nunit-discuss?hl=en.- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Andreas Öhlund

unread,
Nov 2, 2010, 10:21:23 AM11/2/10
to NUnit-Discuss
Same here, bug is fixed in 10305.

Thx!

/Andreas
> > > For more options, visit this group athttp://groups.google.com/group/nunit-discuss?hl=en.-Zitierten Text ausblenden -

Stefan

unread,
Nov 11, 2010, 2:31:16 AM11/11/10
to NUnit-Discuss
Hi,

Using the Development Snapshot version 2.5.9.10308 from Nov 4, problem
#1 still persists.

I am running a .Net Framework 4 Test dll from Nunit Console Runner.
After the tests have completed nunit-agent.exe still lingers around.
This is actually not a problem since the agent seems to get re-used
but when our continous integration system tries to clear the directory
or update the files, it fails. for now I am excluding nunit form
source control as a workaround but I'd really not like to always
distribute nunit dlls manually to all build agents.

Here is the command line that i use to launch the tests:

NUnit-2.5.9.10308\bin\net-2.0\nunit-console.exe /framework=4.0.30319 /
exclude:IgnoreInCI,Weekendrunner,Experimental /labels "C:\Programme
\Software-Concept\Concept Office\Sc.Tests.Anwendungsschicht.dll"

Stefan Noack
> > > > For more options, visit this group athttp://groups.google.com/group/nunit-discuss?hl=en.-ZitiertenText ausblenden -

Stefan

unread,
Nov 11, 2010, 2:48:49 AM11/11/10
to NUnit-Discuss
Hi,

I hope this is not a double post. My first post seems to have gotten
lost.

Problem #1 still persists in Dev Snapshot 2.5.9.1038 from Nov 4.

I run a .Net 4 Test suite from Console Runner but nunit-agent.exe
still lingers around after tests have finished.
Currently, this is just a minor problem since the agent seems to gets
re-used, but i had to remove nunit out of the source tree because the
still-running exe prevents the continuous integration system from
cleaning the directory before checkout.

Stefan Noack

On Nov 2, 3:21 pm, Andreas Öhlund <andreas_ohl...@hotmail.com> wrote:
> > > > For more options, visit this group athttp://groups.google.com/group/nunit-discuss?hl=en.-ZitiertenText ausblenden -

Charlie Poole

unread,
Nov 11, 2010, 11:15:26 AM11/11/10
to nunit-...@googlegroups.com
Hi Stefan,

Both posted 8 hours ago. Meanwhile, I've been asleep. :-)

This is bad news. Some questions...

1. What's the command line being used.

2. What happens if you run the command directly, rather than
through the ci server?

Charlie

Stefan Noack

unread,
Nov 24, 2010, 2:46:46 AM11/24/10
to nunit-...@googlegroups.com
Hi Charlie,

I even updated to 10320 now and the problem still persists.

On Thu, Nov 11, 2010 at 5:15 PM, Charlie Poole <nuni...@gmail.com> wrote
1. What's the command line being used.

To make reading and commenting each option that I pass easier I'll list them one option per line:

NUnit-2.5.9.10320\bin\net-2.0\nunit-console.exe
  /framework=4.0.30319
  /exclude:IgnoreInCI,Weekendrunner,Experimental
  /labels
  "C:\Programme\Software-Concept\Concept Office\Sc.Tests.Anwendungsschicht.dll"

That line is run by a .cmd script on a virtual machine running windows XP. The script is executed by the CI server.

2. What happens if you run the command directly, rather than
   through the ci server?

I think there should be no difference but I'll try running the script (which is just a one-liner) directly.
(... time passes here ...)
Hm.. Nope. Same problem.

Two other things I noticed:

1.) There is at maximum one nunit-agent.exe hanging around. When I run the tests again without killing the lingering agent, a second one ist started but correctly terminated.

2.) the lingering process seems to bee constantly eating up more memory.

The main problem is that because nunit-agent.exe is still running, it prevents the CI server from cleaning the directory it's sitting in. The memory problem is also bad.

Stefan Noack

Stefan Noack

unread,
Nov 24, 2010, 2:53:06 AM11/24/10
to nunit-...@googlegroups.com
Hi,

I've been watching the process for some minutes now and just now the memory usage dropped by 100MB after raising close to the machine's limit for some minutes. But it's annoying still, since right now it's using 150MB of precious memory in a virtual machine host for just no reason. I could do a workaround and manually kill nunit-agent.exe after the test run, though.

Stefan

Charlie Poole

unread,
Dec 3, 2010, 11:30:06 AM12/3/10
to nunit-...@googlegroups.com
Hi Stefan,

I'm back to work, so I'll start looking at this.

Charlie

David Jeske

unread,
Dec 3, 2010, 6:41:28 PM12/3/10
to nunit-...@googlegroups.com
I'd like to inject a small suggestion into this work on Nunit hangs. 

It would be nice if NUnit could be setup to be much more heavy-handed about the unit-under-test. The move to nunit-agent.exe is a good step in this direction.  Now that it's held in a separate process, give me a big "kill" button to hard-kill the entire nunit-agent.exe process and restart it. Of course right now there are some bugs that are causing things to hang, and it'll be nice to work out these bugs. However, I think nunit-gui will be much more stable if it's not so dependent on the result state of an item under test (or even bugs in nunit-agent interacting with tests). 

Right now if I compile more than twice while nunit is up, it starts to go into flashing reload fits, and often hangs indefinitely, so I have to keep up process explorer constantly to force-kill both nunit gui and nunit-agent. I guess I just wish Nunit.gui would just do this for me. :)
Reply all
Reply to author
Forward
0 new messages