Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Pending case-level Windows/Linux CI results leave the concurrency regression unverified across platforms, requiring human confirmation before approval.
No open issues 🎉
What changed in this PR
This test-only PR addresses the shared execution-trace race behind the async test quarantined in #5129, without changing SqlClient product behavior.
Changes:
- Serializes trace insertion in both async reader helpers while leaving database operations concurrent.
- Adds a SQL Server-independent regression test and documents the trace synchronization rule.
- Retains
flakyand addsprobationonly to the affected test, preserving quarantine routing.
| File | Description |
|---|---|
| TESTGUIDE.md | Documents trace synchronization and the regression test. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/DDBasics/DDAsyncTest/DDAsyncTest.cs | Locks shared trace writes, adds concurrency regression coverage, and marks the repaired test for probation. |
Review effort: Balanced
Dates are 2026-11-24 UTC; job/task attempts are 1. These runs used Debug/Project, with Set=3 in 194755 and Set=123 in 194757. Ordinary ranges span the two linked records. The timestamps uniquely place each record in its mapped task, despite merged Windows run titles. Unix publication diagnostic, mapped log 302 / Unix archive metadata |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5142 +/- ##
==========================================
+ Coverage 68.99% 73.23% +4.23%
==========================================
Files 314 315 +1
Lines 45857 71443 +25586
==========================================
+ Hits 31638 52319 +20681
- Misses 14219 19124 +4905
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 This pull request was created by a fully automated workflow.
Description
Repair
Microsoft.Data.SqlClient.ManualTesting.Tests.DDAsyncTest.ExecuteCommand_WithNewConnection_ShouldPerformAsyncByDefault(Fact; no arguments).Demonstrated mechanism: its two reader continuations mutate the same unsynchronized
List<string>. CI recordedIndexOutOfRangeExceptioninsideList.Addin both continuations. Serialize only execution-trace insertion through a shared helper; database operations and awaits remain concurrent. The shared-connection sibling uses the same insertion rule. Existing assertions, query inputs, conditions and Set=3 are preserved; no product/API or pipeline changes.Add
RecordProcess_ConcurrentReaders_SerializesWrites: hold the first collection insertion open, admit a second writer, and verify it waits outside the collection before both records are retained. This controlled ownership regression fails without the lock on both frameworks; it does not reproduce the exact framework-internal array exception. Document the trace ownership rule in TESTGUIDE.md.Retain
[Trait("category", "flaky")]and add[Trait("category", "probation")]to the affected Fact only. Ordinary selection still excludes it; quarantine still executes it. Probation begins separately on each upstream branch only when the repair and both markings actually merge there, never on PR creation. Later category transitions belong to the independent probation reviewer.Release routing blocked: the same shared-list defect exists on release/6.1, /7.0, /7.1 and /8.0. Verified intended labels are
Hotfix 6.1.9,Hotfix 7.0.5,Hotfix 7.1.3andHotfix 8.0.0, respectively. Current release source lacks this Fact's flaky marking; its quarantine backports remain pending (#5133, #5134, #5135 and #5132, respectively). The complete patch fails application checks against all four current snapshots, and documentation needs adaptation (release/7.0 lacks TESTGUIDE.md). No Hotfix labels are applied: compatible whole-diff/category prerequisites need resolution first. Repaired release execution is not claimed.Issues
#5129 quarantined this same Fact and records its original failure/control pair.
Testing
Local Windows SQL Server with integrated authentication, a uniquely named disposable database and two ten-row tables matching the existing queries. This is limited local data coverage, not the full Northwind fixture. net462/native SNI and net10.0/native and managed SNI executed successfully.
Restore passed. Unrepaired regression: 1 failed/framework; repaired focused Debug and Release: 3 passed/framework/configuration, no skips. Managed net10.0 repeated both focused configurations with 3 passes each using the same commands plus
--framework net10.0. Quarantine discovery/execution selects exactly one affected Fact/framework; ordinary selects two cases/framework (sibling and regression), both passing. SQL configuration was supplied through TEST_MDS_CONFIG; earlier missing-Northwind skips are not counted as passes.CI: scoped 194755 completed PartiallySucceeded at the repair SHA, with the Unix limitations below. The affected quarantine Fact, ordinary sibling and regression passed in each Windows framework/SNI configuration: 9/9 cases. 194757 completed Succeeded on the identical PR merge tree; ordinary sibling/regression passed on Windows and Linux: 8/8 cases, with the affected Fact excluded. Individual case records and execution mappings add the precise provenance. These records support review readiness, not indefinite stability.
CI limitation: 194755's existing Unix publisher attempts to parse binary coverage files as TRX, so no Linux SQL25 test run was published. Its quarantine task reported five unrelated bulk-copy/transaction failures; no exact Linux quarantine pass is claimed. The archived ZIP is not readable through the available artifact capability. Linux ordinary execution is independently verified in 194757; pipeline definitions and coverage settings remain unchanged.
Guidelines
Please review the contribution guidelines before submitting a pull request:
Contributing
Code of Conduct
Best Practices
Coding Style
Review Process
Tests added or updated.
Public API changes documented (not applicable: test-only correction).
Verified against customer repro (not applicable: controlled harness regression).
Ensure no breaking changes introduced.