由于 NUnit 锁定文件,TeamCity 构建失败?

发布于 2024-10-13 03:21:04 字数 1297 浏览 4 评论 0原文

我们的项目的持续集成一直存在问题。有时,我们想要尝试清理 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

疾风者 2024-10-20 03:21:04

您是否厌倦了设置“如果运行时间超过 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

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.

我的黑色迷你裙 2024-10-20 03:21:04

我没有令人惊叹的见解,只有显而易见的见解:

  1. 更新到最新版本通常会有所帮助。
  2. 失败的“完整构建(开发分支)”是使用“代理端签出”的唯一配置吗?我看过的其他人都使用“服务器端结帐”。我不是这方面的专家,但你确定需要它吗?

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?
Hello爱情风 2024-10-20 03:21:04

我也有这个问题。我升级到 2.6.012035,现在可以使用了。

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

凉世弥音 2024-10-20 03:21:04

使用 Swabra 插件,Luke
默认情况下包含它

Use Swabra plugin, Luke
It is included by default

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文