步骤超时未正确设置或忽略

时间:2017-06-21 07:02:54

标签: nunit azure-devops azure-pipelines

我们在构建代理上通过VSTS运行了一组Selenium UI测试。它们运行得很好,但由于UI测试本身很慢,我们设置了一个晚上运行的版本 - 然后为测试人员提供详细的报告,让他们在早上阅读。我们使用NUnitTestAdapter.3.7.0来运行测试。

由于运行时间较长,我将“测试组件”的步骤超时 - 这些测试的实时设置为0(无限制)。挺直的吧?然而,由于某些未知原因,该步骤在一小时后仍然被取消 - 切断了大量测试。现在我想我可以创建更小的测试集并添加更多类似的“测试组件” - 步骤,但这对我来说似乎不对。

.trx日志显示测试运行大约一小时后才被取消:

2017-06-21T03:02:36.9610971Z ##[section]Starting: Test Assemblies
2017-06-21T03:02:36.9767239Z ==============================================================================
2017-06-21T03:02:36.9767239Z Task         : Visual Studio Test
2017-06-21T03:02:36.9767239Z Description  : Run tests with Visual Studio test runner
2017-06-21T03:02:36.9767239Z Version      : 1.0.85
2017-06-21T03:02:36.9767239Z Author       : Microsoft Corporation
2017-06-21T03:02:36.9767239Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=624539)
2017-06-21T03:02:36.9767239Z ==============================================================================
2017-06-21T03:02:36.9767239Z Preparing task execution handler.
2017-06-21T03:02:37.3267423Z Executing the powershell script: C:\agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\1.0.85\VSTest.ps1
2017-06-21T03:02:38.0298958Z Working folder: C:\agent\_work\r17\a
2017-06-21T03:02:38.0298958Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "xxx.dll" /TestCaseFilter:"TestCategory=MP2" /Settings:"C:\agent\_work\r17\a\TestResults\1_2017-06-21_05-02-37-AM.runsettings" /logger:trx /TestAdapterPath:"C:\agent\_work\r17\a\drop\b\packages\NUnit3TestAdapter.3.7.0\tools"
2017-06-21T03:02:38.0298958Z Microsoft (R) Test Execution Command Line Tool Version 14.0.25420.1
2017-06-21T03:02:38.0298958Z Copyright (c) Microsoft Corporation.  All rights reserved.
2017-06-21T03:02:38.0298958Z 
2017-06-21T03:02:38.0298958Z Starting test execution, please wait...
2017-06-21T03:02:38.1705198Z Information: NUnit Adapter 3.7.0.0: Test execution started
2017-06-21T03:02:38.1705198Z 

....

2017-06-21T04:01:16.0450600Z ##[warning]No results found to publish.
2017-06-21T04:01:16.2950650Z ##[error]The operation was canceled.
2017-06-21T04:01:16.3106930Z ##[section]Finishing: Test Assemblies

我在这里遗漏了什么吗?这些步骤是否存在严格的上限?

1 个答案:

答案 0 :(得分:1)

请通过以下方面解决问题(基于您使用的是私人代理):

  1. 检查相关构建是否成功:测试结果已成功发布,测试程序集已复制到$(Build.ArtifactStagingDirectory)
  2. 确保您在相关构建定义中发布工件任务。
  3. 检查C:\agent\_work\r17\a中的子文件夹以查找测试程序集是否存在。
  4. 发布超时60分钟,因为您的测试程序集步骤已将超时设置为0,您应检查发布定义中的代理设置,以检查部署超时是否设置为60。 / LI>

    enter image description here