Skip to content

Flaky tests / lighter test queries#4344

Open
mdaigle wants to merge 4 commits into
mainfrom
dev/mdaigle/flaky-tests
Open

Flaky tests / lighter test queries#4344
mdaigle wants to merge 4 commits into
mainfrom
dev/mdaigle/flaky-tests

Conversation

@mdaigle

@mdaigle mdaigle commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Marks a few flaky tests. Rewrites a manual test as a unit test. Reduces CPU/scan impact on a few high volume tests queries.

Copilot AI review requested due to automatic review settings June 5, 2026 23:11
@mdaigle mdaigle requested a review from a team as a code owner June 5, 2026 23:11
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Jun 5, 2026
@mdaigle mdaigle changed the title Dev/mdaigle/flaky tests Flaky tests / lighter test queries Jun 5, 2026
@mdaigle mdaigle added this to the 7.1.0-preview2 milestone Jun 5, 2026
@mdaigle mdaigle added Hotfix 7.0.2 PRs targeting main that should be backported to release/7.0 for the 7.0.2 release. Hotfix 6.1.6 PRs targeting main that should be backported to release/6.1 for the 6.1.6 release. and removed Hotfix 7.0.2 PRs targeting main that should be backported to release/7.0 for the 7.0.2 release. Hotfix 6.1.6 PRs targeting main that should be backported to release/6.1 for the 6.1.6 release. labels Jun 5, 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.

Pull request overview

This pull request updates the SqlClient test suite by quarantining a small set of intermittently failing unit tests, replacing a manual transaction-pool cleanup scenario with a deterministic unit test, and reducing CPU/scan overhead in high-volume MARS manual tests (notably for Azure SQL environments).

Changes:

  • Quarantines a few simulated-server transient fault/failover tests as Category=flaky with inline failure notes where helpful.
  • Adds a deterministic unit test validating that pool pruning does not impact transacted connections, and exposes the pruning callback internally to support that test.
  • Optimizes MARS manual test queries to avoid expensive system scanning (sys.databases, sp_who) while still producing sufficient observable request activity.

Reviewed changes

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

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionTests.cs Marks select transient-fault test cases as flaky to prevent intermittent CI failures.
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs Quarantines an intermittently failing failover-related async test with a documented failure symptom.
src/Microsoft.Data.SqlClient/tests/UnitTests/ConnectionPool/WaitHandleDbConnectionPoolTransactionTest.cs Adds a pruning-focused unit test asserting transacted connections are not pruned/destroyed.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/MARSSessionPoolingTest/MarsSessionPoolingTest.cs Replaces high-cost SQL text/SP usage with lighter alternatives to reduce CPU/scan impact while preserving test intent.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectionPoolTest/TransactionPoolTest.cs Removes the older manual transaction-cleanup test (scenario now covered deterministically via unit test).
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/WaitHandleDbConnectionPool.cs Makes the pruning callback internal (with documentation) so unit tests can invoke pruning deterministically.

@paulmedynski paulmedynski moved this from To triage to In review in SqlClient Board Jun 6, 2026
@paulmedynski paulmedynski added the Area\Tests Issues that are targeted to tests or test projects label Jun 6, 2026
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 review

Development

Successfully merging this pull request may close these issues.

5 participants