由于 NUnit 锁定文件,TeamCity 构建失败?
我们的项目的持续集成一直存在问题。有时,我们想要尝试清理 TeamCity 签出目录中构建时的所有文件。每当我们尝试执行此操作时,nunit-agent.exe
最终会在上一个版本中保持打开状态,从而产生以下错误:
[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
我们总是必须要求有权访问该框的人手动终止该进程在构建再次开始工作之前。 NUnit 必须无限期保持打开状态的原因是什么(我们可以等待 24 小时,它仍然会挂起)?我们是否需要在构建脚本中使用一些命令来强制其终止,或者告诉 TeamCity 如果程序挂起则强制关闭它?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否厌倦了设置“如果运行时间超过 x,则构建失败”设置?
请参阅 http://confluence.jetbrains.net/display/TCD5/1.General+设置
Have you tired setting the 'fail build if it runs lonnger than x' setting?
See http://confluence.jetbrains.net/display/TCD5/1.General+Settings
我没有令人惊叹的见解,只有显而易见的见解:
No stunning insights on my part, only the obvious:
我也有这个问题。我升级到 2.6.012035,现在可以使用了。
I had this issue too. I upgraded to 2.6.012035 and it is now working for me.
使用 Swabra 插件,Luke
默认情况下包含它
Use Swabra plugin, Luke
It is included by default