Skip to content

[7.1] Tests: Backport recent quarantines and stability fixes - #5135

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

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

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.1, reviewed through 51da3ab3483ab9f5fa3442d4193ae82c1e1c2d24 (November 23). Companion 8.0 backport: #5132.

Applicability and duplication

Do not import absent isolation-reset, isolation-leak, reclaimed-connection reuse, or vector metadata tests/features. Existing schema deadlock retries, #4804, #5094, and #5105 are already on the release branch and are not duplicated. Inspected all open release backports: #4979, #5082, #5097, #5103, and #5124. This PR excludes their PRELOGIN, pipeline/data-source-enumerator, NuGet-audit, encryption-feature, and managed-identity changes.

No public API, package dependency, or pipeline changes. Existing platform conditions and release-specific test inputs are preserved. Repaired tests keep flaky; probation remains metadata rather than promotion into the ordinary suite. Probation starts independently on this branch only when the repair and traits merge.

Validation

  • Focused simulator execution: 137 passed with zero skips on each of net8.0, net9.0, and net10.0. The net10.0 run first had one Address already in use failure; a complete retry passed. Integrated-auth simulator execution is excluded because this Linux environment lacks the required Kerberos context; this is not a claimed pass.

  • All six affected pool regression cases passed on net8.0 with zero failures/skips; --list-tests confirmed the exact selection.

  • UnitTests compiled for the modern targets and net462. ManualTests compiled for net8.0 and net462. The net462 builds succeeded with transient copy-retry warnings from concurrent builds.

  • Discovery verified affected manual quarantines under category=flaky and the scheduler regression under category!=flaky.

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

  • Live-SQL manual execution and Windows/.NET Framework execution remain for CI. No repeated long-term stability claim is made.

  • 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

Apply the inherited fixes from #5137 in 2b353de, although this PR had no inline Copilot findings.

  • Pin the held-slot pool regression to the legacy wait-budget policy and observe actual parked checkout before measuring the hold interval.
  • Propagate simulator handler and diagnostic I/O failures; tolerate only marked physical transport failures and explicitly expected TLS rejection.
  • Require a first physical abort, exactly one configured retry event, and a distinct second-session pre-login gate. 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.
  • Final net8.0 validation: 33 focused cases and all 561 selected broader simulator cases passed, with zero failures/skips. net462 compilation passed with zero warnings/errors. Existing Windows/native SNI, Kerberos, and live-SQL validation gaps remain as documented above.

Consolidate applicable main test-maintenance changes, including simulator lifecycle and fault scheduling fixes, MARS teardown assertions, pool checkout scheduling, virtual timer synchronization, and deterministic transaction pruning. Preserve release-specific APIs and existing quarantine routing; exclude pending backport work.

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 added this to the 7.1.3 milestone Nov 23, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board 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.

🔵 Needs a closer look

The transport/TLS and certificate trust-store backport still requires Windows/.NET Framework/native-SNI validation and live-SQL certificate, service-cleanup, and pooling checks.

No open issues 🎉

What changed in this PR

Backports applicable test quarantines and stability fixes from main to release/7.1. The changes strengthen SqlClient’s test infrastructure without changing production runtime behavior, public APIs, dependencies, or pipelines.

Changes:

  • Stabilize simulator workers, fault injection, transport disposal, and certificate validation; add lifecycle regressions.
  • Repair pool checkout scheduling, timeout synchronization, and instrumentation tests; replace timing-dependent transaction cleanup coverage with deterministic pruning.
  • Apply targeted quarantines, retain flaky on repaired scenarios, and document branch-specific probation tracking.

Live-SQL and Windows/.NET Framework execution remain for CI, as noted in the PR.

File Description
TESTGUIDE.md Documents simulator lifecycle, pool isolation, and certificate testing.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​Utilities/​NotifyingTimeProvider.cs Adds timer-registration notifications for virtual-clock synchronization.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ServerLifecycleTests.cs Adds worker, fault-budget, TLS, and disposal regressions.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ServerEndPointConnectionTests.cs Tests transport initialization against concurrent disposal.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​Fixtures/​GatedTdsServer.cs Adds explicit pre-login response gates.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ConnectionTests.cs Isolates pools and stabilizes retry scenarios.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​SimulatedServerTests/​ConnectionFailoverTests.cs Adds gated failover, physical-connection assertions, and sync/async coverage.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​ConnectionPool/​WaitHandleDbConnectionPoolTransactionTest.cs Adds deterministic transaction-aware pruning coverage.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​ConnectionPool/​DbConnectionPoolInstrumentationTest.cs Aligns checkout budgets and adds a held-slot regression.
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​ConnectionPool/​ChannelDbConnectionPoolTest.cs Waits for timer registration before advancing virtual time.
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 fault quotas atomically and supports rearming.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.Servers/​TransientDelayTdsServer.cs Synchronizes delay quotas and suppresses canceled responses.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.Servers/​TdsServerArguments.cs Adds explicit expected TLS-failure configuration.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.Servers/​GenericTdsServer.cs Passes TLS expectations and atomically detaches disposal ownership.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.EndPoint/​TDSServerEndPointConnection.cs Uses dedicated workers and serializes transport startup/closure.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.EndPoint/​TDSServerEndPoint.cs Registers workers before startup and reports teardown failures.
src/​Microsoft.Data.SqlClient/​tests/​tools/​TDS/​TDS.EndPoint/​TDSParser.cs Distinguishes expected TLS rejection from certificate setup failures.
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 and asynchronous schema tests.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​SplitPacketTest/​SplitPacketTest.cs Quarantines affected split-packet scenarios.
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 strict async no-retry timing assertion.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionTestWithSSLCert/​CertificateTestWithTdsServer.cs Keeps certificates untrusted and tightens expected outcomes.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionTestWithSSLCert/​CertificateTest.cs Quarantines affected certificate connectivity tests.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionPoolTest/​TransactionPoolTest.cs Removes the flaky cleanup test replaced by unit coverage.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionPoolTest/​PoolBlockPeriodTest.cs Quarantines pool-blocking timing coverage.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​ConnectionPoolTest/​ConnectionPoolTest.cs Repairs worker startup and adds a single-worker scheduler regression.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​SQL/​AsyncTest/​MarsReceiveTeardownTest.cs Accepts fatal teardown reporting from either MARS session.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​removecert.ps1 Supports cleanup without changing trust stores; fixes a directory typo.
src/​Microsoft.Data.SqlClient/​tests/​ManualTests/​makepfxcert.ps1 Adds optional trust-store bypass and adjusts certificate copying.
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 Corrects a mismatched-certificate matrix case.
src/​Microsoft.Data.SqlClient/​src/​Microsoft/​Data/​SqlClient/​ConnectionPool/​WaitHandleDbConnectionPool.cs Documents pruning and annotates nullable callback state; logic unchanged.
.github/​instructions/​testing.instructions.md Documents probation metadata and promotion requirements.

Review effort: Balanced

@paulmedynski paulmedynski changed the title Tests: Backport recent quarantines and stability fixes to 7.1 [7.1] Tests: Backport recent quarantines and stability fixes Nov 23, 2026
Propagate simulator handler I/O failures, require a physical failure and observed retry, and synchronize the legacy-budget pool wait regression. Retain quarantine and probation routing.

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

Shutdown can race with in-flight handlers and cause unexpected worker failures, while a connection-close logging exception can escape error tracking and let disposal silently succeed.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Connection-close logging failures escape worker error tracking

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

If the Connection Closed log throws after an otherwise successful session, the connection has already been removed and the worker faults outside its processing catch blocks. A later Stop() neither waits for that worker nor finds the logging failure in _errors, so disposal can silently succeed. Catch and record the logging exception while holding the collection lock.

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

Cleanup errors are suppressed rather than preserved alongside setup failures, and failed certificate removal can still delete thumbprint.txt, losing the leaked certificate’s ownership marker.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Preserve cleanup errors and thumbprint when certificate removal fails

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

RemoveCertificate() suppresses certificate-store errors, and TryCleanup() suppresses file errors, so this handler does not preserve ordinary cleanup failures alongside the setup exception. If certificate export and subsequent store removal both fail, cleanup can also delete thumbprint.txt, losing the leaked certificate's ownership marker. Collect and throw cleanup errors after attempting the remaining steps, and retain the thumbprint when store cleanup fails.

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

Transport/TLS and certificate-lifecycle changes remain unverified on Windows/native SNI, .NET Framework 4.6.2, and live SQL, while certificate scripts were only syntax-checked.

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