microsoft / vstest

Visual Studio Test Platform is the runner and engine that powers test explorer and vstest.console.
MIT License
888 stars 320 forks source link

vstest 17.10.0 System.BadImageFormatException Azure Devops Pipelines #5098

Closed wjdavis5 closed 2 months ago

wjdavis5 commented 3 months ago

Description

Error logged to stderr for ADO Task VSTest2.0 on vstest 17.10.0.

#[error]Data collector 'Code Coverage' message: Data collector caught an exception of type 'System.BadImageFormatException': 'Image is too small.'. More details: ..

https://github.com/actions/runner-images/issues/10068

Steps to reproduce

Run pipeline using windows-latest or windows-2022 since the 17.10.0 update

Expected behavior

Nothing logged to stderr

Actual behavior

The following is logged to stderr #[error]Data collector 'Code Coverage' message: Data collector caught an exception of type 'System.BadImageFormatException': 'Image is too small.'. More details: ..

However code coverage is still generated.

Diagnostic logs

I can provide complete logs privately.

2.1409
Multiple versions of same extension found. Selecting the highest version.
  xunit.runner.visualstudio.dotnetcore.testadapter : 2.4.5.1
##[error]Data collector 'Code Coverage' message: Data collector caught an exception of type 'System.BadImageFormatException': 'Image is too small.'. More details: ..

Environment


Starting: Initialize job
Agent name: 'Azure Pipelines 8'
Agent machine name: 'fv-az171-608'
Current agent version: '3.240.1'
Operating System
Runner Image
Runner Image Provisioner
Current image version: '20240610.1.0'
Agent running as: 'VssAdministrator'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: PowerShell (2.239.1)
Downloading task: DotNetCoreCLI (2.240.0)
Downloading task: SonarCloudPrepare (1.41.1)
##[warning]Task 'Prepare Analysis Configuration' version 1 (SonarCloudPrepare@1) is deprecated.
##[warning]This task is deprecated. Please upgrade to the latest version. For more information, refer to https://docs.sonarsource.com/sonarcloud/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/
Downloading task: VSTest (2.240.1)

... ...


==============================================================================
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.240.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/vstest

... ... ...


C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe "@D:\a\_temp\eaehr3nyi2o.tmp"
Microsoft (R) Test Execution Command Line Tool Version 17.10.0 (x64)
nohwnd commented 3 months ago

@fhnaseer have you seen this problem before? #[error]Data collector 'Code Coverage' message: Data collector caught an exception of type 'System.BadImageFormatException': 'Image is too small.'. More details: ..

fhnaseer commented 3 months ago

@nohwnd Not really. @wjdavis5 can you please share logs?

jonadv commented 3 months ago

related: https://github.com/actions/runner-images/issues/10068#issuecomment-2176510695

wjdavis5 commented 3 months ago

@fhnaseer I'd be happy to share logs privately. They are too verbose for me to really be able to make sure its all good to post publicly.

fhnaseer commented 3 months ago

You can create a ticket here and share logs privately.

wjdavis5 commented 3 months ago

@fhnaseer Case opened: 2406200040000675

fhnaseer commented 3 months ago

Can you please share link?

wjdavis5 commented 3 months ago

Sorry I'm not sure what you mean, I don't have a link, just the case number.

fhnaseer commented 3 months ago

You should have received a ticket link like this https://developercommunity.visualstudio.com/t/MicrosoftCodeCoverageConsole-cant-ins/10686388.

wjdavis5 commented 3 months ago

I went ahead and just scanned the logs and redacted a few things. When I open a ticket at the link you gave me it sends me to services hub to open a ticket and that is what I did. The ticket was routed to azure devops support and I provided you the case number for what I received.

logs.txt

fhnaseer commented 3 months ago

Do you see any logs with filename datacollector in it? Can you please share these?

wjdavis5 commented 3 months ago

The only logs I have available are those provided by the azure devops pipeline interface.

fhnaseer commented 2 months ago

You can enable full logs by providing additional log options in the pipeline => https://github.com/microsoft/vstest/issues/5098#issuecomment-2196794915

nohwnd commented 2 months ago

@wjdavis5 please get back to us with logs if you have some :)

wjdavis5 commented 2 months ago

TempDir.zip I think I found what you needed.

fhnaseer commented 2 months ago

@wjdavis5 Can you please use vstest 17.11.0-release-24352-06 and try again?

wjdavis5 commented 2 months ago

No errors on this version.

@wjdavis5 Can you please use vstest 17.11.0-release-24352-06 and try again?

fhnaseer commented 2 months ago

No errors on this version.

@wjdavis5 Can you please use vstest 17.11.0-release-24352-06 and try again?

Thanks for verifying it. I am closing this issue. Fix will be available in 17.11 release.