不遵守 Azure Pipelines 任务超时

2024-04-03

我正在运行一个天蓝色管道,如下所示。我在 3 个位置设置了以分钟为单位的超时:作业、池和任务,但是步骤运行验收测试总是在 60 分钟后超时,并显示错误消息:

配置资源时发生错误(错误类型:超时)。 操作被取消。

否则,管道中的一切都运行正常。

stages: 
- stage: Run_Acceptance_Tests
  jobs:
  - job: Run_Acceptance_Tests
    timeoutInMinutes: 180
    pool:
      name: Hosted VS2017
      timeoutInMinutes: 180
      demands:
      - msbuild
      - visualstudio
      - vstest

    steps:
    - task: NuGetToolInstaller@0
      displayName: 'Use NuGet 4.4.1'
      inputs:
        versionSpec: 4.4.1

    - task: NuGetCommand@2
      displayName: 'NuGet restore'
      inputs:
        restoreSolution: '$(solution)'

    - task: VSBuild@1
      displayName: 'Build solution'
      inputs:
        solution: '$(solution)'
        msbuildArgs: '/p:SkipInvalidConfigurations=true /p:ExcludeApp_Data=true /p:AutoParameterizationWebConfigConnectionStrings=false /p:MarkWebConfigAssistFilesAsExclude=false /p:ProfileTransformWebConfigEnabled=false /p:TransformWebConfigEnabled=false'
        platform: '$(BuildPlatform)'
        configuration: '$(BuildConfiguration)'

    - task: FileTransform@2
      displayName: 'Transform settings for Acceptance tests'
      inputs:
        folderPath: '$(Build.SourcesDirectory)'
        xmlTransformationRules: '-transform **\Selenium.Tests\App.Test.config -xml **\Selenium.Tests\bin\**\Selenium.Tests.dll.config'    

    - task: VSTest@2
      displayName: 'Run ExcelWraps Acceptance tests'
      timeoutInMinutes: 180
      inputs:
        testAssemblyVer2: |
         **\Selenium.Tests.dll
         !**\obj\**
        searchFolder: '$(Build.SourcesDirectory)'
        pathtoCustomTestAdapters: '$(build.sourcesdirectory)\src\packages\NUnit3TestAdapter.3.10.0\build\net35\'
        runInParallel: false
        codeCoverageEnabled: false
        platform: '$(BuildPlatform)'
        configuration: '$(BuildConfiguration)'
        diagnosticsEnabled: false
        uiTests: true
        minimumExpectedTests: 10    

我已经阅读并重读了文档,似乎已经完成了他们要求的一切。 所有这些问题似乎都已通过将超时放置在我上面提到的位置之一来回答: -https://developercommunity.visualstudio.com/content/problem/375541/60-minutes-time-limit-per-build.html https://developercommunity.visualstudio.com/content/problem/375541/60-minutes-time-limit-per-build.html - https://developercommunity.visualstudio.com/content/problem/567714/azure-devops-timeoutin 分钟-is-being-ignored-in.html https://developercommunity.visualstudio.com/content/problem/567714/azure-devops-timeoutinminutes-is-being-ignored-in.html - https://developercommunity.visualstudio.com/content/problem/670377/timeout-not-respected-in-multi-stage-pipeline.html https://developercommunity.visualstudio.com/content/problem/670377/timeout-not-respected-in-multi-stage-pipeline.html - https://github.com/Microsoft/azure-pipelines-yaml/issues/48 https://github.com/Microsoft/azure-pipelines-yaml/issues/48 - https://github.com/Microsoft/azure-pipelines-agent/issues/1849 https://github.com/Microsoft/azure-pipelines-agent/issues/1849

如何增加测试步骤的超时时间?


在私人项目中,Microsoft 在托管代理中提供的最大超时时间为 60 分钟。

请参阅文档:

避免在您的工作挂起或等待时占用资源 长,最好对你的工作时间设定一个限制 跑步。使用作业超时设置指定限制(以分钟为单位) 用于运行作业。将值设置为零意味着作业可以 跑步:

  • 永远使用自托管代理
  • 在具有公共项目和公共存储库的 Microsoft 托管代理上运行 360 分钟(6 小时)
  • 在 Microsoft 托管的代理上进行 60 分钟的私人项目或 私有存储库
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

不遵守 Azure Pipelines 任务超时 的相关文章

随机推荐