- 
                Notifications
    You must be signed in to change notification settings 
- Fork 316
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 Oct 13, 2025 
      
  This was referenced Oct 20, 2025 
      
  This was referenced Oct 27, 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.csfile to add retry logic for SQL commands and to enhance theSqlBatchCommandfunctionality. The most important changes are as follows:Enhancements to SQL retry logic:
SqlRetryLogicOptionandSqlRetryLogicBaseProviderto handle transient errors like deadlocks by retrying the operation up to three times with a delay of 100 milliseconds.Improvements to
SqlBatchCommand:StoredProcedureBatchSupportedandMixedBatchSupportedmethods to include parameters inSqlBatchCommandfor executing stored procedures, specifically adding a parameter for thesp_helpstored procedure.Additional imports:
System.Collections.Genericimport 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:
@objnamethat 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