-
Notifications
You must be signed in to change notification settings - Fork 314
Tests | Fix SqlBatch Test Deadlocks #3025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Add parameter to sp_help
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3025 +/- ##
==========================================
+ Coverage 72.68% 72.78% +0.09%
==========================================
Files 285 332 +47
Lines 59155 83162 +24007
==========================================
+ Hits 42998 60530 +17532
- Misses 16157 22632 +6475
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
paulmedynski
approved these changes
Mar 20, 2025
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
mdaigle
approved these changes
Mar 21, 2025
This was referenced Jul 25, 2025
Open
This was referenced Sep 8, 2025
Open
paulmedynski
pushed a commit
that referenced
this pull request
Sep 15, 2025
Add parameter to sp_help
This was referenced Sep 15, 2025
paulmedynski
pushed a commit
that referenced
this pull request
Sep 15, 2025
Add parameter to sp_help
This was referenced Sep 15, 2025
cheenamalhotra
pushed a commit
that referenced
this pull request
Sep 26, 2025
* User Story 38467: Backport mac server name fix - Backported part of #3494 and all of #3591: - Added configurable test jobs timeout, defaulting to 90 minutes. - Reduced generated database names to 96 chars to try to fix macOS test failures.Increase test jobs timeout (#3591) - Fixed the unique name generators to: - Keep max lengths to 30 and 96 characters respectively. - Ensure uniqueness at the start of the names. - Added link to database identifier syntax. * User Story 38467: Backport mac server name fix - Added a new test that was erroneously removed in the earlier cherry-pick. - Added MDS_TEST_CONFIG environment variable to unit test config to override where the confi.json file is read from. - Updated xUnit to 2.9.3 to avoid transitive System.Net.Http vulnerability warnings. * Add retry on deadlock for sp_help (#3025) Add parameter to sp_help * User Story 38467: Backport mac server name fix - Fixed cherry-pick of old function name. * User Story 38467: Backport mac server name fix - Removed macOS Azure SQL test configuration that uses service principal based auth that our Azure tenant no longer supports. * User Story 38467: Backport mac server name fix - Adding console diagnostics to slow enclave tests. * User Story 38467: Backport mac server name fix - Adding console diagnostics to slow enclave tests. * User Story 38467: Backport mac server name fix - Adding console diagnostics to slow enclave tests. * Tests | Remove hardcoded credentials from ManualTests (#3204) * Initial removal of CertificateUtility.CreateCertificate One test implied that DataTestUtility.AKVUrl would point to an RSA key which aligned with the certificate's private key. Switching this to dynamically generate the key in places. * Hotfix for Azure Key Vault tests * Removed hardcoded references to Azure Key Vault key * Removed hardcoded references to CertificateUtilityWin These were mostly related to generating CSP keys. * Code review changes * Reorder properties and constructors * Move AEConnectionStringProviderWithCspParameters to its own file * Tweak to the AKV token acquisition * Code review Redundant bracket, alphabetised the ManualTesting csproj * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs Let's try @edwardneal's idea Co-authored-by: Edward Neal <[email protected]> * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs Co-authored-by: Edward Neal <[email protected]> * Fixes as per @edwardneal's suggestions * Fix as per @edwardneal's suggestion * Fix missing `new` Co-authored-by: Edward Neal <[email protected]> * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategyAzureKeyVault.cs Co-authored-by: Edward Neal <[email protected]> * Update src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategyAzureKeyVault.cs Co-authored-by: Edward Neal <[email protected]> * Address comment that we don't need a CspParameters object as part of the test arguments * Move test arguments into property (the class was only used in a single location) * Cleanup test code * Tweak default provider discovery code to handle edge cases a bit better * Address comment regarding readonly member variables Apply long line chomping * Addressing the last of the comments. --------- Co-authored-by: Edward Neal <[email protected]> * - Fixed incorrect unique database object name function that doesn't compile normally. * Updated TestUtilities project to target the same framework as the test project(s) it is compiling with. * Removed diagnostic logging now that Enclave tests are passing. --------- Co-authored-by: Michel Zehnder <[email protected]> Co-authored-by: Benjamin Russell <[email protected]> Co-authored-by: Edward Neal <[email protected]>
This was referenced Sep 28, 2025
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.
AI Blurp
This pull request includes changes to the
BatchTests.cs
file to add retry logic for SQL commands and to enhance theSqlBatchCommand
functionality. The most important changes are as follows:Enhancements to SQL retry logic:
SqlRetryLogicOption
andSqlRetryLogicBaseProvider
to handle transient errors like deadlocks by retrying the operation up to three times with a delay of 100 milliseconds.Improvements to
SqlBatchCommand
:StoredProcedureBatchSupported
andMixedBatchSupported
methods to include parameters inSqlBatchCommand
for executing stored procedures, specifically adding a parameter for thesp_help
stored procedure.Additional imports:
System.Collections.Generic
import to support the use ofList<SqlParameter>
in the updated methods.Description
I regularly see deadlocks for the tests that use
sp_help
.I'll try to mitigate this in 2 different ways:
@objname
that does less work so it's less likely to get a deadlockIt can probably also be solved by just using another stored procedure that's not prone to deadlocks, but I chose this way as the easiest path
Example test failure:
https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=101959&view=logs&j=700ebecb-e440-5400-66bb-488206e790af&t=d8ae6a68-b967-5b1e-ef3d-1b53d82075ee&l=826