microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.49k stars 2.61k forks source link

[BUG]: VsTest task failed without any Error on Microsoft-Hosted agent (Windows-2022) #18113

Closed firmaulana closed 11 months ago

firmaulana commented 1 year ago

Task name

VSTestV2

Task version

2.219.0

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows-2022

Task log

Starting: Test Assemblies
==============================================================================
Task         : Visual Studio Test
Description  : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
Version      : 2.219.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/vstest
==============================================================================
Running tests using vstest.console.exe runner.
======================================================
Test selector : Test assemblies
Test filter criteria : undefined
Search folder : D:\a\1\s
Action when minimum tests threshold not met : donothing
Minimum tests expected to be run: 0
VisualStudio version selected for test execution : latest
Attempting to find vstest.console from a visual studio installation with version [17.0,18.0).
Run in parallel : false
Run in isolation : false
Path to custom adapters : undefined
Other console options : undefined
Code coverage enabled : false
Diagnostics enabled : true
Run the tests locally using vstest.console.exe
========================================================
Source filter: **\release\*test*.dll,!**\obj\**
======================================================
##[error]VsTest task failed.
Finishing: Test Assemblies

Relevant log output

##[error]VsTest task failed.

2023-04-14T01:50:07.8325012Z ======================================================
2023-04-14T01:50:07.8326534Z ##[debug]Agent.Version=3.218.0
2023-04-14T01:50:07.8327313Z ##[debug]Release.ReleaseUri=undefined
2023-04-14T01:50:07.8328315Z ##[debug]Release.ReleaseId=undefined
2023-04-14T01:50:07.8328850Z ##[debug]Build.BuildUri=vstfs:///Build/Build/86556
2023-04-14T01:50:07.8329373Z ##[debug]Build.Buildid=86556
2023-04-14T01:50:07.8329761Z ##[debug]telemetry area: TestExecution feature: TestExecutionTask data: {"builduri":"vstfs:///Build/Build/86556","buildid":"86556","state":"completed"}
2023-04-14T01:50:07.8667093Z ##[debug]Processed: ##vso[telemetry.publish area=TestExecution;feature=TestExecutionTask;]{"builduri":"vstfs:///Build/Build/86556","buildid":"86556","state":"completed"}
2023-04-14T01:50:07.8668349Z ##[debug]task result: Failed
2023-04-14T01:50:07.8669005Z ##[error]VsTest task failed.
2023-04-14T01:50:07.8669650Z ##[debug]Processed: ##vso[task.issue type=error;]VsTest task failed.
2023-04-14T01:50:07.8674399Z ##[debug]Processed: ##vso[task.complete result=Failed;done=true;]VsTest task failed.
2023-04-14T01:50:07.8701375Z ##[section]Finishing: Test Assemblies

Aditional info

We have several pipelines that use VSTest V2 task to run the unit tests.
Several days ago it runs ok, but it start failed since yesterday (13 April).
It is hard to determine the cause since the logs are unclear.
I have enabled the system diagnostics logs and I am not sure it provides sufficient information.

We are using Microsoft-Hosted Agent Pool (Azure Pipeline) with windows-2022 as the agent-specification.

Here is the YAML:
steps:
- task: VSTest@2
  displayName: 'Test Assemblies'
  inputs:
    testAssemblyVer2: |
     **\$(BuildConfiguration)\*test*.dll
     !**\obj\**
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    diagnosticsEnabled: True
  continueOnError: true
MS-Manikandan commented 1 year ago

I too face the same issue issue when test ran using VsTest task on version 2.220.0 in azure agents version 3.220.1. The agent is a self hosted service agent.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days