Skip to content

Finish sqlclient-stress pipeline#4198

Open
paulmedynski wants to merge 9 commits intomainfrom
dev/paul/stress-pipeline
Open

Finish sqlclient-stress pipeline#4198
paulmedynski wants to merge 9 commits intomainfrom
dev/paul/stress-pipeline

Conversation

@paulmedynski
Copy link
Copy Markdown
Contributor

@paulmedynski paulmedynski commented Apr 15, 2026

Description

Now that the sqlclient-stress pipeline has been defined in the Public project, we can actually see it running based on the new YAML files. This PR works through issues until the stress tests run properly.

Changes

Pipeline fixes

  • Fix ADO.Net pipeline resource name — Updated the referenced pipeline folder/name in stress-tests-pipeline.yml after it was moved.
  • Fix three stress pipeline failures (Win/Linux/macOS) — Corrected various issues preventing successful pipeline execution.
  • Fix variable group scoping — Removed --artifacts-path from dotnet arguments, added ADO Build Properties variable group, fixed variable group casing.
  • Continue running stress tests after a runtime failure — Test steps now use condition: succeededOrFailed() gated on a buildSucceeded flag so all runtimes are tested even if one fails, but tests are skipped if the build/setup fails. The overall job still reports failure.
  • Remove unused dotnetArtifactsDir variable from stress-tests-job.yml.

SNI native DLL transitive flow

  • Remove PrivateAssets=All from Microsoft.Data.SqlClient.SNI in the main SqlClient csproj so the native SNI DLL flows transitively via ProjectReference. This eliminates the need for every test project to carry its own explicit SNI PackageReference (the stress tests were missing them, causing DllNotFoundException on net462).
  • Remove redundant SNI PackageReference entries from UnitTests, ManualTests, and FunctionalTests.
  • The nuspec (which is the authoritative source for NuGet package consumers) is unaffected — it independently declares the SNI dependency.

PackageReference cleanup

  • Replace verbose IncludeAssets with ExcludeAssets="compile" on all SNI and xunit runner PackageReferences across the codebase. Functionally equivalent but more concise.
  • Remove PrivateAssets="all" from SNI refs in ref/ and notsupported/ projects, and from xunit runner refs in all test projects (no project references the test projects, so it had no effect).

Checklist

  • Tests added or updated
  • Verified pipeline runs
  • No breaking changes introduced

Copilot AI review requested due to automatic review settings April 15, 2026 14:14
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Apr 15, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Apr 15, 2026
@paulmedynski paulmedynski added this to the 7.1.0-preview1 milestone Apr 15, 2026
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label Apr 15, 2026
Copy link
Copy Markdown
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

This PR updates the stress-test Azure DevOps pipeline resource configuration and adjusts Managed SNI SPN generation so named-instance connections without a protocol prefix use the SSRP-resolved port (with added unit test coverage).

Changes:

  • Update Managed SNI SPN postfix selection to use SSRP-resolved port for non-NP protocols when connecting to named instances (incl. Protocol.None/admin:).
  • Add unit tests covering SPN generation for Protocol.None, tcp:, np:, admin:, and custom ServerSPN.
  • Fix the stress pipeline resource source path for the ADO.Net “MDS Main CI” pipeline.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/ManagedSni/SniProxyGetSqlServerSPNsTest.cs Adds regression/unit tests for SPN construction across protocols and custom SPN override.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProxy.netcore.cs Adjusts SPN postfix logic to prefer SSRP-resolved port for non-NP named-instance connections; exposes helpers for unit testing.
eng/pipelines/stress/stress-tests-pipeline.yml Updates the referenced ADO.Net pipeline folder/name for the stress pipeline resource trigger.

Comment thread eng/pipelines/stress/stress-tests-pipeline.yml
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.64%. Comparing base (f5c41ee) to head (7af633c).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4198      +/-   ##
==========================================
- Coverage   66.63%   65.64%   -1.00%     
==========================================
  Files         279      271       -8     
  Lines       42999    65716   +22717     
==========================================
+ Hits        28651    43137   +14486     
- Misses      14348    22579    +8231     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 65.64% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings April 15, 2026 19:09
Copy link
Copy Markdown
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

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

Comments suppressed due to low confidence (1)

eng/pipelines/stress/stress-tests-job.yml:100

  • dotnetArtifactsDir is still defined but is no longer used after removing --artifacts-path $(dotnetArtifactsDir) from dotnetArguments. Either remove this variable or reintroduce its usage so the job definition stays minimal and avoids confusion about where build outputs are expected.
      # The directory where dotnet artifacts will be staged.  Not to be
      # confused with pipeline artifacts.
      - name: dotnetArtifactsDir
        value: $(Build.StagingDirectory)/dotnetArtifacts

Copilot AI review requested due to automatic review settings April 16, 2026 11:47
- Import 'ADO Test Configuration Properties' variable group so the
  configure-sql-server-win-step template gets x64AliasRegistryPath and
  other SQL alias variables it expects.
- Align stress test TargetFrameworks with SqlClient's shipped TFMs
  (net8.0;net9.0) to avoid assembly version mismatches when running
  net8.0 tests built with the .NET 10 SDK.
- Add NuGetAuthenticate@1 step before the build so hosted pool agents
  (macOS) can fetch upstream packages through the ADO Artifacts feed.
- Move 'ADO Test Configuration Properties' variable group from stage to
  job template so it is not shadowed by the job's own variables block.
- Remove --artifacts-path from dotnet CLI arguments to avoid MSB3277
  warnings caused by SqlClient's custom OutputPath colliding across TFMs.
- Add 'ADO Build properties' group which provides x64AliasRegistryPath,
  x86AliasRegistryPath, SQLAliasName, and SQLAliasPort needed by the
  Windows SQL Server configuration step template.
- Fix 'ADO Test Configuration Properties' -> 'ADO Test Configuration
  properties' (lowercase 'p') to match the actual group name in ADO.
Remove PrivateAssets=All and IncludeAssets from the Microsoft.Data.SqlClient.SNI
PackageReference in the main SqlClient csproj so the native SNI DLL flows
transitively through ProjectReference. This eliminates the need for every test
project to carry its own explicit SNI PackageReference.

Remove the now-unnecessary SNI PackageReferences from UnitTests, ManualTests,
and FunctionalTests csproj files.
@paulmedynski paulmedynski force-pushed the dev/paul/stress-pipeline branch from 4df9022 to 7bf66ef Compare April 16, 2026 11:52
Copy link
Copy Markdown
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

eng/pipelines/stress/stress-tests-job.yml:103

  • dotnetArtifactsDir is now unused because --artifacts-path $(dotnetArtifactsDir) was removed from dotnetArguments. Either remove dotnetArtifactsDir (and related comment) to avoid confusion, or reintroduce the argument if artifacts staging is still required by downstream steps.
      # The directory where dotnet artifacts will be staged.  Not to be
      # confused with pipeline artifacts.
      - name: dotnetArtifactsDir
        value: $(Build.StagingDirectory)/dotnetArtifacts

Comment thread eng/pipelines/stress/stress-tests-job.yml Outdated
Add name to the build step and condition test steps with
succeededOrFailed() gated on the build step's success. This ensures:
- All test runtimes run even if a prior runtime fails
- Test steps are skipped if the build or setup fails
- Any test failure still fails the overall job
Copilot AI review requested due to automatic review settings April 16, 2026 12:56
@paulmedynski paulmedynski force-pushed the dev/paul/stress-pipeline branch from 9d5a7b1 to c02833c Compare April 16, 2026 12:56
Copy link
Copy Markdown
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

eng/pipelines/stress/stress-tests-job.yml:103

  • dotnetArtifactsDir is still defined, but --artifacts-path $(dotnetArtifactsDir) was removed from dotnetArguments, so this variable is now unused. Consider either removing dotnetArtifactsDir (and the related comment) or reintroducing the argument if staging build outputs is still required for troubleshooting/artifact collection.
      # The directory where dotnet artifacts will be staged.  Not to be
      # confused with pipeline artifacts.
      - name: dotnetArtifactsDir
        value: $(Build.StagingDirectory)/dotnetArtifacts

Comment thread src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj Outdated
Comment thread eng/pipelines/stress/stress-tests-job.yml Outdated
- Replace verbose IncludeAssets with ExcludeAssets="compile" on all
  PackageReferences that only needed to exclude compile-time assets.
- Remove PrivateAssets="all" from SNI refs (ref/, notsupported/, src/)
  so the native DLL flows transitively via ProjectReference. The nuspec
  remains the authority for NuGet package consumers.
- Remove PrivateAssets="all" from xunit runner refs in test projects
  since no project references the test projects.
- Remove unused dotnetArtifactsDir variable from stress-tests-job.yml.
- Fix variable group casing (ADO Build/Test Configuration Properties).
Add a top-level failOnTestFailure parameter (default: false) threaded
through pipeline, stage, and job templates. When false, test failures
produce warnings (SucceededWithIssues) instead of failing the pipeline.
When true, test failures fail the job.

Document the interaction between condition, buildSucceeded flag, and
continueOnError in the job template.
Copilot AI review requested due to automatic review settings April 16, 2026 14:16
Copy link
Copy Markdown
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread eng/pipelines/stress/stress-tests-job.yml Outdated

<PackageReference Include="Microsoft.Bcl.Cryptography" />
<PackageReference Include="Microsoft.Data.SqlClient.SNI"
PrivateAssets="all"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The PrivateAssets=all is the root cause of our test projects failing to find the SNI DLLs when building in Project ref mode. Eureka!

So I removed them all to avoid wondering why some projects have them and others don't.

<PackageReference Include="Microsoft.Data.SqlClient.SNI"
PrivateAssets="all"
IncludeAssets="runtime;build;native;contentfiles;analyzers;buildtransitive" />
<PackageReference Include="Microsoft.Data.SqlClient.SNI" ExcludeAssets="compile" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's much clearer to Exclude compile than to Include everything else.


<PackageReference Include="Azure.Identity" />
<PackageReference Include="Microsoft.Bcl.Cryptography" />
<PackageReference Include="Microsoft.Data.SqlClient.SNI"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't need these in any of our downstream (i.e. test) projects now.

<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
<PackageReference Include="System.Security.Cryptography.Pkcs" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.console"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I cleaned up the xUnit references as well, for consistency.

@paulmedynski paulmedynski marked this pull request as ready for review April 16, 2026 17:33
@paulmedynski paulmedynski requested a review from a team as a code owner April 16, 2026 17:33
Copilot AI review requested due to automatic review settings April 16, 2026 17:33
Copy link
Copy Markdown
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

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

@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board Apr 16, 2026
@paulmedynski paulmedynski added the Hotfix Candidate 🚑 Issues/PRs that are candidate for backporting to earlier supported versions. label Apr 16, 2026
@paulmedynski paulmedynski removed the Hotfix Candidate 🚑 Issues/PRs that are candidate for backporting to earlier supported versions. label Apr 22, 2026
@paulmedynski paulmedynski enabled auto-merge (squash) April 22, 2026 10:58
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.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants