Repository navigation
Quarantine new flaky tests - #4453
Conversation
…flaky - Quarantining more flaky tests.
There was a problem hiding this comment.
Pull request overview
This PR quarantines several intermittently failing unit tests by marking them with the Category=flaky trait so they’re excluded from the default CI test filter.
Changes:
- Added
[Trait("Category", "flaky")]to additional simulated-server and connection-pool unit tests. - Updated/expanded inline comments around flaky failures (including pasted CI failure output).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionTests.cs | Quarantines an async transient-fault retry test. |
| src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionRoutingTests.cs | Quarantines a routed-location network delay test. |
| src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs | Quarantines additional failover/transient-fault test cases and adjusts related comments. |
| src/Microsoft.Data.SqlClient/tests/UnitTests/ConnectionPool/WaitHandleDbConnectionPoolShutdownTest.cs | Quarantines a shutdown/unblock waiter test that can fail on slow agents. |
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
… ConnectionTest Root-cause fix replacing the earlier ConnectionTest quarantine (3cebfbd). A failing pooled Open() against a non-Azure endpoint (localhost) enters a 5-second BlockingPeriodErrorState that is keyed by connection string. When a later test's ephemeral TdsServer reuses the same port, it inherits the cached exception via ThrowIfActive() and fails without contacting the new server. ConnectionTest was thus failing with a cached InvalidTDSVersion error seeded by ConnectionRefusesUnsupportedServerTdsVersion. Add Pooling=false to the failure-injecting tests so their expected failures do not poison a shared pool: - ConnectionTests: RequestEncryption_ServerDoesNotSupportEncryption_ShouldFail, TransientFault_RetryDisabled_ShouldFail(+_Async), ConnectionTimeoutTest(+Async), ConnectionRefusesUnsupportedServerTdsVersion, TestConnWithVectorFeatExtVersionNegotiation - ConnectionRoutingTests / ConnectionRoutingTestsAzure: TransientFaultAtRoutedLocation_RetryDisabled_ShouldFail - ConnectionReadOnlyRoutingTests: RecursivelyRouted{,Async}Connection (ConnectionRoutingLimit) Remove the [Trait("Category","flaky")] from ConnectionTest: it was a poisoning victim, not a genuine flake, and is deterministic once the source is fixed. Genuine timing-race quarantines are left in place. Relates to PR #4453 (Quarantine new flaky tests).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:359
- Spelling in the quoted failure text: "Principle server" should be "Principal server" (as in the primary/principal endpoint).
Microsoft.Data.SqlClient.SqlException : Connection Timeout Expired. The timeout period elapsed during the post-login phase.
The connection could have timed out while waiting for server to complete the login process and respond;
Or it could have timed out while attempting to create multiple active connections.
This failure occurred while attempting to connect to the Principle server.
The duration spent while attempting to connect to this server was - [Pre-Login] initialization=6; handshake=80;
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:423
- Spelling in the quoted failure text: "Principle server" should be "Principal server" (as in the primary/principal endpoint).
Microsoft.Data.SqlClient.SqlException : Connection Timeout Expired.
The timeout period elapsed during the post-login phase.
The connection could have timed out while waiting for server to complete the login process and respond;
Or it could have timed out while attempting to create multiple active connections.
This failure occurred while attempting to connect to the Principle server.
The duration spent while attempting to connect to this server was - [Pre-Login] initialization=4; handshake=68;
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:432
- Spelling in the quoted failure text: "Principle server" should be "Principal server" (as in the primary/principal endpoint).
Microsoft.Data.SqlClient.SqlException : Connection Timeout Expired.
The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.
This could be because the pre-login handshake failed or the server was unable to respond back in time.
This failure occurred while attempting to connect to the Principle server.
The duration spent while attempting to connect to this server was - [Pre-Login] initialization=0; handshake=5285;
|
There are more flaky tests:
|
|
@cheenamalhotra - Tracking the connection/command timeouts as AB#46533. I'll keep quarantining flaky tests as they appear in the PR runs, but I'd like to get this merged once I get a green run. |
The Lima hostagent that backs Colima intermittently fails to become ready
within its short startup window on the macOS CI runners ("hostagent did not
start up in 5s"), which is transient. Retry 'colima start' up to 3 times,
dumping ha.stderr.log and tearing down the half-created instance
(colima delete --force) between attempts before giving up.
Relates to PR #4453 (Quarantine new flaky tests).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (4)
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:358
- Spelling in the TODO failure text: "Principle server" should be "Principal server".
This failure occurred while attempting to connect to the Principle server.
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:422
- Spelling in the TODO failure text: "Principle server" should be "Principal server".
This failure occurred while attempting to connect to the Principle server.
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:431
- Spelling in the TODO failure text: "Principle server" should be "Principal server".
This failure occurred while attempting to connect to the Principle server.
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionTests.cs:642
- In ConnectionTimeoutTestAsync, the Stopwatch is only stopped in the catch block. If OpenAsync unexpectedly succeeds (or throws outside the catch), the timer can remain running and the failure message becomes misleading. Stop the timer in a finally so the assertions report the real issue.
Pooling = false, // Disable pooling so this expected timeout failure does not poison a shared pool
}.ConnectionString;
using SqlConnection connection = new(connStr);
// Dispose the server to force connection timeout
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4453 +/- ##
==========================================
- Coverage 65.83% 64.93% -0.91%
==========================================
Files 287 287
Lines 43763 66958 +23195
==========================================
+ Hits 28812 43476 +14664
- Misses 14951 23482 +8531
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:
|
|
We achieved green PR runs while in Draft. I have moved to Open, which unfortunately re-triggers everything. I will babysit this until these new PR runs are green. |
The async non-pooled open runs the entire multi-hop routing chain in a single thread-pool-scheduled continuation under one Connect Timeout budget (default 15s). Under CI thread-pool congestion, 12 in-process TdsServers contend for the same starved pool, so the 11-hop chain can exceed 15s and trip a NonPooledOpenTimeout (only the async variant is affected; the sync path runs on the caller thread). Add ConnectTimeout=60 to the recursive routing test connections so the chain rides out CI congestion while preserving the 11-succeed / 12-fail boundary coverage. Relates to PR #4453 (Quarantine new flaky tests).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (3)
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:358
- In this quoted failure text, "Principle server" is a spelling error (should be "Principal server"). Since this comment block was touched in this PR, please correct the wording to avoid confusion when scanning logs.
This failure occurred while attempting to connect to the Principle server.
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:422
- In this quoted failure text, "Principle server" is a spelling error (should be "Principal server"). Since this comment block was touched in this PR, please correct the wording to avoid confusion when scanning logs.
This failure occurred while attempting to connect to the Principle server.
src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs:431
- In this quoted failure text, "Principle server" is a spelling error (should be "Principal server"). Since this comment block was touched in this PR, please correct the wording to avoid confusion when scanning logs.
This failure occurred while attempting to connect to the Principle server.
Some minimal changes to get our PR pipelines green: