Skip to content

[7.0] Tests: Backport recent quarantines and stability fixes - #5134

Draft
paulmedynski wants to merge 4 commits into
release/7.0from
dev/automation/quarantine-backports-7.0
Draft

paulmedynski wants to merge 4 commits into
release/7.0from
dev/automation/quarantine-backports-7.0

Conversation

@paulmedynski

@paulmedynski paulmedynski commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Consolidated backport of applicable recent main quarantines and flaky-test improvements to release/7.0, reviewed through 51da3ab3483ab9f5fa3442d4193ae82c1e1c2d24 (November 23). Companion 8.0 backport: #5132.

Applicability and duplication

Do not import absent isolation-reset, isolation-leak, reclaimed-connection reuse, vector metadata, pool instrumentation, transaction-pool unit, or virtual-time timeout scenarios. Earlier failover quarantines and schema deadlock retries are already present and are not duplicated. Inspected all open release backports: #4979, #5082, #5097, #5103, and #5124; their work is excluded.

No production driver, public API, dependency, or pipeline changes. Preserve release-specific APIs, platform conditions, test inputs, and quarantines. Probation is tracking metadata and starts independently on this branch only when the repair and both traits merge; it does not route tests into the ordinary suite.

Validation

  • Focused simulator execution passed all 123 selected cases on each of net8.0, net9.0, and net10.0, with zero failures/skips in the final runs. Integrated-auth simulator execution is excluded because this Linux environment lacks the required Kerberos context.

  • ManualTests compiled on net8.0 with zero warnings/errors. Discovery verified affected manual quarantines and confirmed the scheduler regression stays outside quarantine.

  • Certificate scripts passed PowerShell syntax checks; they were not executed. git diff --check passed.

  • net462 compilation could not be completed on this Linux host: after restoring explicit framework assets and using cached reference assemblies, referenced projects still omit net462 in host-based framework selection. No build files or dependencies were changed to bypass that limitation.

  • Live-SQL manual tests, Windows/.NET Framework builds/execution, and long-term quarantine stability remain for CI.

  • Tests added or updated

  • Public API changes documented (not applicable)

  • Verified against customer repro (not applicable; test-maintenance backport)

  • Ensure no breaking changes introduced

Review follow-up

Addressed both Copilot comments in bcf4663; the inherited main fixes are in #5137.

  • Restore the release-specific class-level flaky trait on ConnectionFailoverTests. Discovery confirms all six identified cases remain selected by category=flaky, with no ConnectionFailoverTests cases selected by category!=flaky. Removing that trait was a backport error, not an upstream quarantine change.
  • Replace the delayed-open retry scenario with a first physical abort, exactly one observed retry event, and a distinct second-session pre-login gate before success. Cover sync/async opens and both MultiSubnetFailover settings. Use an explicit configurable network-error policy because ConnectRetryCount does not retry a pre-login reset; retain flaky and add probation. Removing the first abort fails all four retry cases.
  • Propagate simulator handler and diagnostic I/O failures, retaining tolerance only for marked physical failures and explicitly expected TLS rejection.
  • Final net8.0 validation: 31 focused cases and all 528 selected broader simulator cases passed, with zero failures/skips. Existing Windows/net462, Kerberos, and live-SQL validation gaps remain as documented above.

Consolidate applicable main quarantines, simulator lifecycle and fault scheduling fixes, MARS teardown assertions, and the pool checkout scheduler regression. Adapt to existing release APIs without importing absent feature tests or overlapping pending backports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 18:34
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Nov 23, 2026
@paulmedynski paulmedynski added the Area\Tests Issues that are targeted to tests or test projects label Nov 23, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Nov 23, 2026
@paulmedynski paulmedynski modified the milestones: 7.1.3, 7.0.5 Nov 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The changes remove required flaky-test quarantines and weaken connection regression coverage by allowing the test to pass without exercising a failed attempt or retry.

2 open issues
What changed in this PR

Backports test quarantines and stability fixes to release/7.0, adapting upstream changes to the branch’s existing test APIs. No production driver, public API, dependency, or pipeline changes are included.

Changes:

  • Adds targeted manual-test quarantines and probation metadata for repaired tests.
  • Stabilizes simulator workers, fault quotas, transport lifecycle, failover setup, and certificate handling.
  • Repairs pool-checkout scheduling and MARS teardown assertions, with focused regression coverage.
File Description
TESTGUIDE.md Documents simulator ownership, isolation, and certificate practices.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ServerLifecycleTests.cs Adds lifecycle, TLS, scheduling, and fault-quota regressions.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ServerEndPointConnectionTests.cs Tests transport startup against concurrent disposal.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​Fixtures/​GatedTdsServer.cs Adds explicit pre-login response gating.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ConnectionTests.cs Revises retry setup, pool isolation, and timing assertions.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ConnectionFailoverTests.cs Adds gated failover, physical-connection assertions, and async cases.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS/​TDSUtilities.cs Prevents TLS negotiation when encryption metadata is omitted.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.Servers/​TransientTdsErrorTdsServer.cs Reserves error quotas atomically and supports rearming.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.Servers/​TransientDelayTdsServer.cs Reserves delay quotas atomically and cancels waits during disposal.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.Servers/​TdsServerArguments.cs Adds an expected TLS-failure option.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.Servers/​GenericTdsServer.cs Tracks login requests and updates endpoint disposal.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.EndPoint/​TDSServerEndPointConnection.cs Uses dedicated workers and serializes transport startup with closure.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.EndPoint/​TDSServerEndPoint.cs Registers workers before startup and collects shutdown failures.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.EndPoint/​TDSParser.cs Distinguishes expected TLS failures from certificate setup errors.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​TracingTests/​EventSourceTest.cs Quarantines listener-enumeration instability.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​SqlSchemaInfoTest/​SqlSchemaInfoTest.cs Quarantines synchronous schema tests.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​SplitPacketTest/​SplitPacketTest.cs Quarantines four split-packet tests.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​MARSTest/​MARSTest.cs Quarantines shared-connection MARS concurrency testing.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectivityTests/​ConnectivityTest.cs Quarantines the async no-retry timing assertion.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionTestWithSSLCert/​CertificateTestWithTdsServer.cs Keeps certificates untrusted and improves assertions and cleanup.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionTestWithSSLCert/​CertificateTest.cs Quarantines two certificate tests.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionPoolTest/​TransactionPoolTest.cs Quarantines transaction-pool cleanup testing.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionPoolTest/​PoolBlockPeriodTest.cs Quarantines blocking-period timing assertions.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionPoolTest/​ConnectionPoolTest.cs Repairs worker scheduling and adds a single-worker scheduler regression.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​AsyncTest/​MarsReceiveTeardownTest.cs Accepts either session reporting the required fatal error.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​removecert.ps1 Supports cleanup without changing root trust stores.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​makepfxcert.ps1 Adds certificate generation without trust installation.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​DDBasics/​DDAsyncTest/​DDAsyncTest.cs Quarantines the concurrent list-write failure.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​DataCommon/​ConnectionTestParametersData.cs Replaces a contradictory duplicate certificate case.

Review effort: Balanced

@paulmedynski paulmedynski changed the title Tests: Backport recent quarantines and stability fixes to 7.0 [7.0] Tests: Backport recent quarantines and stability fixes Nov 23, 2026
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.34%. Comparing base (75ec803) to head (b16bb89).
⚠️ Report is 5 commits behind head on release/7.0.

❗ There is a different number of reports uploaded between BASE (75ec803) and HEAD (b16bb89). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (75ec803) HEAD (b16bb89)
CI-SqlClient 1 0
Additional details and impacted files
@@               Coverage Diff               @@
##           release/7.0    #5134      +/-   ##
===============================================
- Coverage        73.59%   66.34%   -7.26%     
===============================================
  Files              296      291       -5     
  Lines            43521    66427   +22906     
===============================================
+ Hits             32030    44069   +12039     
- Misses           11491    22358   +10867     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 66.34% <ø> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

Restore the release-specific failover class quarantine, propagate simulator handler I/O failures, and prove physical failure followed by an observed configurable retry on sync and async opens.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved issues allow certificate-generation failures to bypass cleanup, connection-close logging exceptions to go unreported, and endpoint disposal races to turn normal teardown into simulator failures.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity PowerShell failures are ignored, bypassing cleanup

src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionTestWithSSLCert/​CertificateTestWithTdsServer.cs:70

This new cleanup path does not run for certificate-generation failures: makepfxcert.ps1 catches errors and only writes a message, and RunPowershellScript checks for a timeout but never checks the process exit code. A failed generation therefore returns normally, leaving partial setup behind and allowing the test to load a missing or stale PFX. Propagate script failures and reject unsuccessful exit codes so this catch actually performs the intended cleanup.

Medium severity Connection-close logging failures are not recorded

src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.EndPoint/​TDSServerEndPoint.cs:349

If the connection-closed log writer throws after this removal, the worker task faults without recording the error, and a later Stop() can succeed without reporting it. Catch the logging exception under the existing collection lock and add it to _errors; add a regression with a writer that fails specifically on the connection-closed message.

2 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The supplied Linux runs and script syntax checks leave transport/TLS and certificate changes unvalidated on Windows/native-SNI, net462, and live-SQL paths, including actual certificate-script execution.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 13:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because the test’s synchronization can let it pass without blocking on a full pool, leaving the new scheduler regression’s coverage uncertain.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

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

Labels

Area\Tests Issues that are targeted to tests or test projects

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants