Skip to content

[6.0] Port Flaky Test Separation#4059

Open
benrr101 wants to merge 10 commits intorelease/6.0from
dev/russellben/flaky/6.0
Open

[6.0] Port Flaky Test Separation#4059
benrr101 wants to merge 10 commits intorelease/6.0from
dev/russellben/flaky/6.0

Conversation

@benrr101
Copy link
Contributor

Description

This PR ports the flaky test separation from the main branch into the 6.0 branch.

  • Adds flaky category trait to applicable tests from main branch. Some tests didn't exist so they have been omitted.
  • Split a couple tests that were flaky on one OS so they can run as un-flaky on the good OS and run as flaky on the bad OS
  • Rewrite the build.proj targets to match the paradigm from main
  • Update ci pipelines to run w/o flaky tests, then run w/flaky tests, ignoring the results.

🤖

Codex ported the pipeline changes from main

Testing

Changes mostly apply to pipeline runs, so they will be validated here.

benrr101 added 10 commits March 17, 2026 13:52
 .TestParametersWithDatatablesTVPInsert
 .TestParametersWithSqlRecordsTVPInsert
 .TestDateOnlyTVPDataTable_CommandSP
 .TestDateOnlyTVPSqlDataRecord_CommandSP
 .TestScaledDecimalTCP_CommandSP
 .ClosedConnection_SqlParameterValueTest_MacOs (split into MacOS and non-MacOS)
@benrr101 benrr101 added this to the 6.0.6 milestone Mar 17, 2026
@benrr101 benrr101 requested a review from a team as a code owner March 17, 2026 22:28
@benrr101 benrr101 added Area\Tests Issues that are targeted to tests or test projects Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. labels Mar 17, 2026
Copilot AI review requested due to automatic review settings March 17, 2026 22:28
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports the main-branch “flaky test separation” approach into the 6.0 branch by marking known-flaky tests and updating build/pipeline orchestration so CI runs non-flaky tests first, then runs flaky tests separately while ignoring their failures.

Changes:

  • Added Trait("Category", "flaky") to selected manual/functional tests and split a couple tests by OS so only the problematic OS run is marked flaky.
  • Updated the run-all-tests-step.yml template to execute an additional “flaky-only” test pass (--filter category=flaky) with continueOnError: true.
  • Refactored build.proj test targets to build a reusable dotnet test command with shared filter/blame/coverage arguments.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/ManualTests/TracingTests/XEventsTracingTest.cs Marks XEvents tracing theory as flaky via trait.
src/Microsoft.Data.SqlClient/tests/ManualTests/TracingTests/DiagnosticTest.cs Marks DiagnosticTest as flaky via class-level trait.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/WeakRefTestYukonSpecific/WeakRefTestYukonSpecific.cs Marks TestReaderMars as flaky via trait.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpTest.cs Marks TVP test as flaky via trait.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/ParametersTest.cs Marks several tests flaky and splits one test into mac/non-mac variants.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/MARSSessionPoolingTest/MARSSessionPoolingTest.cs Replaces ActiveIssue skips with flaky categorization.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/InstanceNameTest/InstanceNameTest.cs Splits instance-name test into mac/non-mac variants, marking mac as flaky.
src/Microsoft.Data.SqlClient.sln Adds eng/ and pipeline YAMLs as solution items/folders.
eng/pipelines/common/templates/steps/run-all-tests-step.yml Adds separate flaky test runs for functional/manual tests and ignores flaky failures.
build.proj Introduces default filter/coverage/blame args and restructures test targets to use shared command composition.

<!-- Collect code coverage unless explicitly disabled -->
<CollectCodeCoverage Condition="'$(CollectCodeCoverage)' == ''">true</CollectCodeCoverage>
<CodeCoverageRunSettings>$(TestsPath)/tools/Microsoft.Data.SqlClient.TestUtilities/CodeCoverage.runsettings</CodeCoverageRunSettings>
<CollectArgument Condition="'$(CollectCodeCoverate)' == 'true'">
<BlameArgument>$(Blame)</BlameArgument>
<BlameArgument Condition="'$(BlameArgument)' == ''">
--blame-hang
--blame-hang-dump-tup full
Comment on lines +212 to +217
-v n
-p:Configuration=$(Configuration)
-p:Target$(TFGroup)Version=$(TF)
-p:TestTargetOS=Windows$(TargetGroup)
-p:ReferenceType=$(ReferenceType)
$(FilterArgument)
-p:Configuration=$(Configuration)
-p:TargetNetCoreVersion=$(TF)
-p:TestTargetOS=Unixnetcoreapp
-p:ReferenceType=$(ReferenceType)
Comment on lines +274 to +275
<Message Text=">>> Running Functional test for Windows via command: $(TestCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(TestCommand)" />
<!-- Convert more than one whitespace character into one space -->
<TestCommand>$([System.Text.RegularExpressions.Regex]::Replace($(TestCommand), "\s+", " "))</TestCommand>
</PropertyGroup>
<Message Text=">>> Running Functional test for Windows via command: $(TestCommand)" />


[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.IsNotAzureServer), nameof(DataTestUtility.IsNotAzureSynapse), nameof(DataTestUtility.AreConnStringsSetup))]
[PlatformSpecific(~TestPlatforms.OSX)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know we could use ~ like this for negation. cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. Area\Tests Issues that are targeted to tests or test projects

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

3 participants