2

We have been having an issue with our project's Continuous Integration. Occasionally, we want to try to clean all of the files on build within TeamCity in its checkout directory. Whenever we try to do this, nunit-agent.exe ends up remaining open from the previous build, yielding the following errors:

[05:35:40]: [Updating sources: Agent side checkout...] Failed to delete file: C:\TeamCity\buildAgent\work\path\to\UnitTestResults.xml
[05:35:40]: [Updating sources: Agent side checkout...] Failed to delete file: C:\TeamCity\buildAgent\work\path\to\src\packages\NUnit.2.5.7.10213\Tools\lib\nunit-console-runner.dll
[05:35:40]: [Updating sources: Agent side checkout...] Failed to delete file: C:\TeamCity\buildAgent\work\path\to\src\packages\NUnit.2.5.7.10213\Tools\lib\nunit.core.dll
[05:35:40]: [Updating sources: Agent side checkout...] Failed to delete file: C:\TeamCity\buildAgent\work\path\to\src\packages\NUnit.2.5.7.10213\Tools\lib\nunit.core.interfaces.dll
[05:35:40]: [Updating sources: Agent side checkout...] Failed to delete file: C:\TeamCity\buildAgent\work\path\to\src\packages\NUnit.2.5.7.10213\Tools\lib\nunit.util.dll
[05:35:40]: [Updating sources: Agent side checkout...] Failed to delete file: C:\TeamCity\buildAgent\work\path\to\src\packages\NUnit.2.5.7.10213\Tools\nunit-agent.exe

We always have to ask someone who has access to the box to manually kill the process before the build starts working again. What reasons would NUnit have to remain open indefinitely (we can wait 24 hours and it'll still be hanging)? Is there some command we need to use in our build script to force it to terminate, or to tell TeamCity that if a program hangs to force close it?

Doctor Blue
  • 3,769
  • 6
  • 40
  • 63
  • How are you running NUnit - are you running it yourself from a script, or using using the TeamCity NUnit runner in a build step? – adrianbanks Jan 21 '11 at 00:12
  • Running it myself from an exe included in the repository itself (nunit-console.exe). – Doctor Blue Jan 21 '11 at 01:12
  • 1
    monitor the processes that are running on the build agent when your build executes. You are probably not terminating nunit-console.exe when it has finished running the tests, leaving a lingering process after the build completes. – adrianbanks Jan 21 '11 at 11:17
  • Having this issue too. Running Nunit via psake. Did you find a solution? – JamesEggers Feb 14 '12 at 15:33
  • Running NUnit from my script, I see that the nunit-agent-x86.exe process isn't disposing properly. Looking into how to ensure they close since it'll probably be the same issue as you are having. – JamesEggers Feb 14 '12 at 15:59
  • Have you specified `/m` switch to run tests in parallel? If so use (can't recall exctly) `/vr:f` switch as well. – sll Feb 14 '12 at 19:37
  • @sil nunit-console.exe doesn't have a `/m` nor a `/vf:f` switch. – JamesEggers Feb 14 '12 at 20:04
  • Did you get past this? – Chazt3n Jun 28 '16 at 18:36

4 Answers4

0

Use Swabra plugin, Luke It is included by default

0

Have you tired setting the 'fail build if it runs lonnger than x' setting?

See http://confluence.jetbrains.net/display/TCD5/1.General+Settings

Check this option and enter a value in minutes to enable time control on the build. If the specified amount of time is exceeded, the build is automatically canceled. This option helps to deal with builds that hang and maintains agent efficiency.

redsquare
  • 78,161
  • 20
  • 151
  • 159
  • Yep, that's set to 10 minutes. This occurs immediately after the build begins (since the NUnit process never quits even if the build fails). – Doctor Blue Jan 21 '11 at 01:11
0

No stunning insights on my part, only the obvious:

  1. Updating to the latest version usually helps.
  2. Is the failing "Full Build (dev branch)" the only configuration using "agent side checkout"? The others I looked at all use "server side checkout". I'm no expert on the difference, but are you sure you need it?
flipdoubt
  • 13,897
  • 15
  • 64
  • 96
  • This type of failure has also occurred on the Default branch build. It basically happens whenever "Clean all files before build" is checked within TeamCity settings. – Doctor Blue Jan 21 '11 at 13:58
0

I had this issue too. I upgraded to 2.6.012035 and it is now working for me.

JamesEggers
  • 12,885
  • 14
  • 59
  • 86