actions / runner-images

GitHub Actions runner images
MIT License
10.03k stars 3.03k forks source link

System.BadImageFormatException for VSTest@2 task in agent version 3.240.1 #10068

Closed genedodge closed 2 months ago

genedodge commented 3 months ago

Description

On release of agent version 3.240.1, builds started failing for a pipeline that uses the VSTest@2 task.

This release may or may not be the cause?

Platforms affected

Runner images affected

Image version and build link

20240610.1.1 https://github.com/actions/runner-images/releases/tag/win22%2F20240610.1

Is it regression?

Agent version 3.239.1 did not exhibit this issue

Expected behavior

Tests are run and coverage is collected

Actual behavior

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

Repro steps

Add VSTest@2 task to yaml build pipeline and run on agent 3.240.1 to see the error

Exact task in affected pipeline is:

  - task: VSTest@2
    displayName: 'Run Unit Tests'
    inputs:
      testAssemblyVer2: |
       **\*Test.Unit.dll
       **\*Tests*
       !**\obj\**
      vsTestVersion: latest
      runInParallel: false
      codeCoverageEnabled: true
      platform: '$(BuildPlatform)'
      configuration: '${{parameters.buildConfiguration}}'
      runSettingsFile: './coverage.runsettings'
hemanthmanga commented 3 months ago

@genedodge Thank you for bringing this issue to us, we are investigating on this issue and we will update you on this issue after our findings.

jonadv commented 3 months ago

Also had this issue, it seems related to this checkbox image of Visual Studio Test

unchecking that box made the pipeline complete

hemanthmanga commented 3 months ago

@jonadv

image

Please enable code coverage checkbox as mentioned in the above screenshot.

hemanthmanga commented 3 months ago

@jonadv could please provide your comments.

jonadv commented 3 months ago

@hemanthmanga sorry, dont have the time to test this in our environment or share logs. i just meant it as an indication for people looking into this once it is fixed, we can turn it back on again and see if it works

same goes for my comment here

fhnaseer commented 2 months ago

This has been fixed and will be available in vstest 17.11 release.

hemanthmanga commented 2 months ago

@genedodge @jonadv We have verified the same as per the issue , It got fixed with 17.11 release[Vstest], closing this issue, Thank you.