Flaky tests / lighter test queries#4344
Open
mdaigle wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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=flakywith 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Marks a few flaky tests. Rewrites a manual test as a unit test. Reduces CPU/scan impact on a few high volume tests queries.