6

We are using Microsoft Azure DevOps to build and run tests.

We have 10 Microsoft provided agents and use YAML (defaultVmImage: 'windows-latest') to build and run tests.

Sometimes the tests take 40mins. Sometimes they take 1hour 40mins!

Why is there such a difference? Surely it's not noise neighbours? Are they in different geo locations?

enter image description here

(example AGENT_MACHINENAME "fv-az689")

https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#capabilities-and-limitations

Could we detect a slow agent and fail the build early?

Collection perf info hasn't helped https://github.com/microsoft/azure-pipelines-tasks/blob/master/ci/

enter image description here

  - task: DotNetCoreCLI@2
    displayName: 'dotnet test'
    inputs:
      command: test
      projects: '**/*.Tests/**/*.Tests.dll'
      arguments: --verbosity detailed --filter "$(testFilter)"
Michael Blake
  • 2,068
  • 2
  • 18
  • 31
  • Hi Michael, are you running the same pipeline with no difference? If so, is there big changes in source file which may affect the test related task in that pipeline? If possibile, please share the timeline of two pipelines(40 minutes and 1H40mins), I would like to make sure which task in that agent job makes the big difference. Also, you can choose to share the full log(System.debug=true) of these pipelines here via github link or other microsoft tool so that we can check it for you. (Note!!! Delete all the personal info in log before sharing the log!!!) – LoLance Apr 22 '20 at 07:39
  • @LanceLi-MSFT I've updated the question with the history of the pipeline and the task. It's just a dotnet task that runs Machine.Specification tests (some that call Azure storage) I don't carfe they take 30-40mins. I care they *sometimes* take over an 1hour. Same branch. – Michael Blake May 22 '20 at 11:08
  • Check if my [another issue](https://stackoverflow.com/questions/61691646/how-does-microsoft-hosted-agent-relate-to-vmimage-types/61721526#61721526) can give some useful info. I guess a possible workaround could be : 1. Do some tests and confirm the faster machine name/ID for you. 2. Then add a CMD/PS task to queue a new build and cancel current build. – LoLance May 26 '20 at 09:39
  • To queue a build see [here](https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-5.1), to cancel a build you can use command `Write-Host “##vso[task.setvariable variable=agent.jobstatus;]canceled”` in PS task. – LoLance May 26 '20 at 09:41

0 Answers0