开发者

TeamCity Build Fails Because NUnit is Locking Files?

开发者 https://www.devze.com 2023-02-05 06:28 出处:网络
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 d

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?


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.


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?


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


Use Swabra plugin, Luke It is included by default

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号