Skip to content

Conversation

@kbth
Copy link
Contributor

@kbth kbth commented Apr 30, 2025

Problem

Automated tests for the main branch are intermittently failing (though they sometimes succeed).
See: https://ci.appveyor.com/project/StackExchange/dapper

Example:

  Failed SystemSqlClientParameterTests.TestTVPWithAnonymousEmptyObject [33 ms]
  Error Message:
   System.Data.SqlClient.SqlException : Could not find the type 'int_list_type'. Either it does not exist or you do not have the necessary permission.

Cause

This is likely due to database-dependent tests being executed in parallel.

On December 22, 2024, AppVeyor updated their build image, which now includes the .NET 9 SDK:
https://www.appveyor.com/updates/2024/12/22/

Since Dapper targets multiple frameworks, this update caused tests to start running in parallel by default.

For multi-targeted projects, tests are run for each targeted framework. The test host and the unit test framework are packaged as NuGet packages and are restored as ordinary dependencies for the project. Starting with the .NET 9 SDK, these tests are run in parallel by default.

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=dotnet-test-with-vstest#description-1

Solution

Following the official documentation, disable parallel execution of tests across TargetFrameworks.

To disable parallel execution, set the TestTfmsInParallel MSBuild property to false.

@mgravell
Copy link
Member

CI is my personal nemesis. Appreciated.

@mgravell mgravell merged commit 5c7143f into DapperLib:main Apr 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants