Visitar URL original
Fix pool instrumentation checkout test wait budget by mdaigle · Pull Request #5039 · dotnet/SqlClient · GitHub
Skip to content

Fix pool instrumentation checkout test wait budget - #5039

Open
mdaigle wants to merge 2 commits into
mainfrom
dev/mdaigle/flaky-test-repairs
Open

mdaigle wants to merge 2 commits into
mainfrom
dev/mdaigle/flaky-test-repairs

Conversation

@mdaigle

@mdaigle mdaigle commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🤖 This pull request was created by a fully automated workflow.

Description

Fix DbConnectionPoolInstrumentationTest.ConcurrentCheckoutAndReturn_SettlesAllGaugesToZero by configuring the instrumentation class's pool wait in milliseconds to match its existing 30-second caller budget. The shared harness otherwise supplies only 15 ms, so ordinary contention can return null before the concurrent instrumentation test finishes.

Keep all 400 checkouts, eight workers, four pool slots and counter assertions. A controlled held-slot regression exercises the same fixture: WaitHandle failed before correction on both frameworks; Channel controls passed. All instrumentation tests use one common 30-second creation timeout, without a checkout-specific helper. The shared harness used by other classes is unchanged. No production API, dependency, localization or pipeline changes.

Retain flaky and add probation; the monitoring interval begins only when a merge makes the repair and both markings effective upstream.

Issues

#5020 quarantined this exact theory; its flaky marking is preserved. No issue is closed.

Testing

dotnet test src\Microsoft.Data.SqlClient\tests\UnitTests\Microsoft.Data.SqlClient.UnitTests.csproj --no-restore -c Release --filter "FullyQualifiedName~DbConnectionPoolInstrumentationTest" -v:q --blame-hang-timeout 2m — passed: 30 net462 / 30 net10.0, zero skipped. Debug also passed 30 per framework after the shared-timeout simplification in 43af4017a.

Controlled regression: failed before / passed after on both frameworks. Ordinary filters exclude the affected theory; existing quarantine filters select it. On predecessor 786757aa8, CI individually verified both original cases and both regressions passing on Windows net462/net10.0 Release/Project and net10.0 Release/Package; ordinary Debug CI also passed the regressions on Windows and Linux. Current-head CI is pending. Broader prior runs retain unrelated quarantine hangs/job timeouts and a Linux result-publication error; no full-suite pass is claimed. Maintained evidence contains additional result provenance and coverage boundaries.

  • Tests added or updated
  • Public API changes documented (none; test-only correction)
  • Verified against customer repro (not applicable; CI failure and controlled contention regression)
  • Ensure no breaking changes introduced (production behavior unchanged)

Guidelines

Please review the contribution guidelines before submitting a pull request:

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 17:06
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Nov 11, 2026
@mdaigle

mdaigle commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Additional validation evidence

Historical WaitHandle comparison, same source
5aaa9ef090135a9a462f31d2e7945d97baa9e65b, definition 1879,
Release/Project, Win22_Sql17/net462_AnyCPU_3, attempt 1:
failure: 190106/3682592/102426
at 2026-11-07T01:18:17.760Z (Assert.NotNull, 67 ms);
passing control: 190082/3682470/104475
at 2026-11-06T23:43:16.983Z.

For predecessor 786757aa8fca40ddc038fc62346472138e01315b, these are individually verified
passing results, not aggregate job-status inferences. Pairs are WaitHandle/Channel;
the regression is ConcurrentCheckoutAndReturn_HeldSlot_WaitsAndBalancesCounters.
All rows: Release/AnyCPU, Windows Server 2022, Win22_Sql17, attempt 1.

Build / run References / framework / SNI job Affected theory IDs Regression IDs UTC interval, 2026-11-11
191223 / 3699522 Project / net462 / native 103871 / 103864 102035 / 102042 20:06:45-20:08:20
191223 / 3699490 Project / net10.0 / managed 104006 / 104012 101787 / 103536 20:07:46-20:09:12
191179 / 3700257 Package / net10.0 / native 103996 / 104007 103237 / 101710 20:50:50-20:52:14

Quarantine/ordinary log IDs: build 191223 net462 83/78, net10.0 80/79;
build 191179 native net10.0 351/347. Result pages reconcile with run totals.

Coverage boundaries: no individually published Linux quarantine or
Package/net462 results were available. Fake connections do not exercise SQL,
SNI or enclaves. The controlled regression demonstrates premature completion,
not an exact replay of the historical eight-worker scheduling.

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

Trusted policy revisions, current PR reviewer feedback, and required scoped Azure DevOps validation are unavailable, so reported local passes cannot establish the repair’s validity on the affected CI image.

No open issues 🎉

What changed in this PR

Corrects the pool instrumentation test’s legacy checkout wait from the harness’s 15-millisecond default to the intended 30-second budget, without changing production behavior.

Changes:

  • Shares the 30-second budget between pool configuration and caller timeout while preserving other tests’ defaults.
  • Adds a held-slot contention regression for both pool implementations, checking completion and balanced counters.
  • Retains flaky and adds probation, preserving the existing concurrency workload and assertions.
File Description
src/​Microsoft.Data.SqlClient/​tests/​UnitTests/​ConnectionPool/​DbConnectionPoolInstrumentationTest.cs Aligns checkout wait budgets, adds contention coverage, and marks the repaired theory for probation.

Review effort: Balanced

@mdaigle mdaigle added this to the 8.1.0-preview1 milestone Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.51%. Comparing base (d8a60de) to head (43af401).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5039      +/-   ##
==========================================
+ Coverage   68.74%   72.51%   +3.76%     
==========================================
  Files         314      314              
  Lines       45849    71135   +25286     
==========================================
+ Hits        31519    51580   +20061     
- Misses      14330    19555    +5225     
Flag Coverage Δ
CI-SqlClient ?
sqlclient-pr 72.51% <ø> (?)

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.

@mdaigle
mdaigle marked this pull request as ready for review November 11, 2026 21:19
@mdaigle
mdaigle requested a review from a team as a code owner November 11, 2026 21:19
@mdaigle mdaigle added the Area\Tests Issues that are targeted to tests or test projects label Nov 13, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:20

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

Required trusted immutable review-policy references were not supplied, and current-head CI is still pending for the timing-sensitive test repair.

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: To triage

Development

Successfully merging this pull request may close these issues.

4 participants